diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..f0897a5 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,36 @@ +name: test +on: + push: + tags: + - v* + branches: + - main + - release-* + pull_request: +permissions: + contents: read + +jobs: + unit: + timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + os: [ubuntu-24.04] + go-version: [1.23.x, 1.24.x] + race: ["-race", ""] + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go-version }} + - run: go test -timeout 3m ${{ matrix.race }} -v ./... + + all-done: + needs: + - unit + runs-on: ubuntu-24.04 + steps: + - run: echo "All jobs completed" diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..8c28fb9 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,87 @@ +name: validate +on: + push: + tags: + - v* + branches: + - main + - release-* + pull_request: +env: + GO_VERSION: 1.24 +permissions: + contents: read + +jobs: + lint: + timeout-minutes: 30 + permissions: + contents: read + pull-requests: read + checks: write # to allow the action to annotate code in the PR. + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 2 + - uses: actions/setup-go@v5 + with: + go-version: "${{ env.GO_VERSION }}" + - uses: golangci/golangci-lint-action@v6 + with: + version: v1.64 + # Extra linters, only checking new code from a pull request. + - name: lint-extra + if: github.event_name == 'pull_request' + run: | + golangci-lint run --config .golangci-extra.yml --new-from-rev=HEAD~1 + + go-fix: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 2 + - uses: actions/setup-go@v5 + with: + go-version: "${{ env.GO_VERSION }}" + - name: run go fix + run: | + go fix ./... + git diff --exit-code + + codespell: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: install deps + # Use a known version of codespell. + run: pip install --break-system-packages codespell==v2.4.1 + - name: run codespell + run: codespell + + space-at-eol: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - run: if git -P grep -I -n '\s$'; then echo "^^^ extra whitespace at EOL, please fix"; exit 1; fi + + deps: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: "${{ env.GO_VERSION }}" + - run: go mod tidy --diff + + all-done: + needs: + - codespell + - deps + - go-fix + - lint + - space-at-eol + runs-on: ubuntu-24.04 + steps: + - run: echo "All jobs completed" diff --git a/.golangci-extra.yml b/.golangci-extra.yml new file mode 100644 index 0000000..1a12d7b --- /dev/null +++ b/.golangci-extra.yml @@ -0,0 +1,12 @@ +# This is golangci-lint config file which is used to check NEW code in +# github PRs only (see lint-extra in .github/workflows/validate.yml). +# +# For the default linter config, see .golangci.yml. This config should +# only enable additional linters not enabled in the default config. + +linters: + disable-all: true + enable: + - godot + - revive + diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..66aa75a --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,13 @@ +# For documentation, see https://golangci-lint.run/usage/configuration/ + +linters: + enable: + - gofumpt + - errorlint + - unconvert + - unparam + +linters-settings: + govet: + enable: + - nilness diff --git a/RELEASES.md b/RELEASES.md index 028ec26..e380270 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -23,7 +23,7 @@ However, specification releases have special restrictions in the [OCI charter][c * They are the target of backwards compatibility (§7.g), and * They are subject to the OFWa patent grant (§8.d and e). -To avoid unfortunate side effects (onerous backwards compatibity requirements or Member resignations), the following additional procedures apply to specification releases: +To avoid unfortunate side effects (onerous backwards compatibility requirements or Member resignations), the following additional procedures apply to specification releases: ### Planning a release