Add cycle detection to the encoder (#33) #22
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: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| go-pkg: ['go_1_17', 'go_1_18', 'go_1_19', 'go_1_20', 'go_1_21', 'go_1_22'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: nixbuild/nix-quick-install-action@v34 | |
| - name: Restore and cache Nix store | |
| uses: nix-community/cache-nix-action@v6.1.3 | |
| with: | |
| primary-key: nix-${{ runner.os }}-${{ matrix.go-pkg }}-${{ hashFiles('shell.nix') }} | |
| - name: Format check | |
| run: nix-shell --argstr goPackage "${{ matrix.go-pkg }}" --run "test -z \$(gofmt -l .)" | |
| - name: Build | |
| run: nix-shell --argstr goPackage "${{ matrix.go-pkg }}" --run "go build ./..." | |
| - name: Test | |
| run: nix-shell --argstr goPackage "${{ matrix.go-pkg }}" --run "go test -v -cover ./..." | |
| - name: Vet | |
| run: nix-shell --argstr goPackage "${{ matrix.go-pkg }}" --run "go vet ./..." | |
| # Rollup job for branch protection - only require this single check | |
| ci: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: always() | |
| steps: | |
| - name: Check all matrix jobs passed | |
| run: | | |
| if [[ "${{ needs.test.result }}" != "success" ]]; then | |
| echo "Matrix jobs failed" | |
| exit 1 | |
| fi |