A Path to v2.0 #153
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: [push, pull_request] | |
| # Default to 'contents: read', which grants actions to read commits. Any | |
| # permission not included is implicitly set to "none". | |
| # | |
| # see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 # guardrails timeout | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| go: ["1.12", "1.21", "1.22", "1.23", "oldstable", "stable"] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Set up Go | |
| uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 | |
| with: | |
| go-version: ${{ matrix.go }} | |
| - name: Test | |
| # Cannot enable shuffle for now because some tests rely on global state and order | |
| # run: go test -race -v -shuffle=on ./... | |
| run: go test -race -v ./... | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 # guardrails timeout | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Set up Go | |
| uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 | |
| with: | |
| go-version: "stable" | |
| - name: Lint | |
| uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 | |
| with: | |
| version: v2.7 | |
| test-v2: | |
| name: Test v2 | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| defaults: | |
| run: | |
| working-directory: ./v2 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| go: [oldstable, stable] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Set up Go | |
| uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 | |
| with: | |
| go-version: ${{ matrix.go }} | |
| - name: Lint | |
| uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 | |
| with: | |
| version: latest | |
| working-directory: ./v2 | |
| - name: Test | |
| # Cannot enable shuffle for now because some tests rely on global state and order | |
| # run: go test -race -v -shuffle=on ./... | |
| run: go test -race -v ./... | |
| conformance-v2: | |
| name: Conformance v2 (flag drop-in + POSIX/GNU) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| defaults: | |
| run: | |
| working-directory: ./v2 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| go: [oldstable, stable] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Set up Go | |
| uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 | |
| with: | |
| go-version: ${{ matrix.go }} | |
| # The conformance suites (see v2/conformance/README.md) run the stdlib | |
| # flag tests and the POSIX/GNU syntax tests against pflag v2. The two specs | |
| # conflict by design (POSIX wins), so the oracle gates on the documented | |
| # divergence catalogue rather than on a raw pass/fail: green iff failures | |
| # match v2/conformance/divergences.json exactly. NOTE: this is expected to | |
| # be red until v2 implements the flag API. | |
| - name: Conformance (oracle gates on the divergence catalogue) | |
| run: go test -tags conformance -json ./conformance | go run ./conformance/hack/oracle |