diff --git a/.github/workflows/golangci.yml b/.github/workflows/golangci.yml index 75c590f..7a2c7f2 100644 --- a/.github/workflows/golangci.yml +++ b/.github/workflows/golangci.yml @@ -16,7 +16,8 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - name: Checkout code + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Install Go uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 @@ -33,7 +34,8 @@ jobs: name: test runs-on: ubuntu-latest steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - name: Checkout code + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Install Go uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 @@ -41,13 +43,23 @@ jobs: go-version-file: '.go-version' - name: run go test - run: go test -v ./... + run: go test -v -coverprofile=coverage.out ./... + + - name: upload coverage report + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 + with: + path: coverage.out + name: coverage-report + + - name: display coverage report + run: go tool cover -func=coverage.out go-mod-tidy: name: tidy runs-on: ubuntu-latest steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - name: Checkout code + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Install Go uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 @@ -61,7 +73,8 @@ jobs: name: build executables runs-on: 'ubuntu-latest' steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - name: Checkout code + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Install Go uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 diff --git a/.go-version b/.go-version index d2ab029..a1b6e17 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.21 +1.23 diff --git a/addlicense/main.go b/addlicense/main.go index 0f67a53..6f311db 100644 --- a/addlicense/main.go +++ b/addlicense/main.go @@ -361,7 +361,7 @@ func licenseHeader(path string, tmpl *template.Template, data LicenseData) ([]by switch fileExtension(base) { case ".c", ".h", ".gv", ".java", ".scala", ".kt", ".kts": lic, err = executeTemplate(tmpl, data, "/*", " * ", " */") - case ".js", ".mjs", ".cjs", ".jsx", ".tsx", ".css", ".scss", ".sass", ".ts": + case ".js", ".mjs", ".cjs", ".jsx", ".tsx", ".css", ".scss", ".sass", ".ts", ".gjs", ".gts": lic, err = executeTemplate(tmpl, data, "/**", " * ", " */") case ".cc", ".cpp", ".cs", ".go", ".hh", ".hpp", ".m", ".mm", ".proto", ".rs", ".swift", ".dart", ".groovy", ".v", ".sv", ".lr": lic, err = executeTemplate(tmpl, data, "", "// ", "") diff --git a/addlicense/main_test.go b/addlicense/main_test.go index bc5f098..9c00803 100644 --- a/addlicense/main_test.go +++ b/addlicense/main_test.go @@ -308,7 +308,7 @@ func TestLicenseHeader(t *testing.T) { "/*\n * HYS\n */\n\n", }, { - []string{"f.js", "f.mjs", "f.cjs", "f.jsx", "f.tsx", "f.css", "f.scss", "f.sass", "f.ts"}, + []string{"f.js", "f.mjs", "f.cjs", "f.jsx", "f.tsx", "f.css", "f.scss", "f.sass", "f.ts", "f.gjs", "f.gts"}, "/**\n * HYS\n */\n\n", }, { diff --git a/go.mod b/go.mod index c102eab..2869b63 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/hashicorp/copywrite -go 1.21 +go 1.23 toolchain go1.23.1