test: split devenv shell commands #78
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: CodeChecks | |
| on: | |
| push: | |
| paths: | |
| - ".github/workflows/codeChecks.yml" | |
| - ".goreleaser.yaml" | |
| - ".testcoverage.yml" | |
| - "devenv.*" | |
| - "cmd/**" | |
| - "internal/**" | |
| - "pkg/**" | |
| - "*.go" | |
| - "go.*" | |
| jobs: | |
| go_tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| max-parallel: 1 | |
| matrix: | |
| go-version: ["1.25"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| - name: Install dependencies | |
| run: go get . | |
| - name: Build | |
| run: go build -v ./... | |
| - name: Test with the Go CLI | |
| run: go test -v ./... | |
| - name: Check for vulnerabilities | |
| uses: golang/govulncheck-action@v1 | |
| with: | |
| go-version-input: ${{ matrix.go-version }} | |
| go-package: ./... | |
| work-dir: . | |
| devenv_test: | |
| needs: go_tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - uses: cachix/install-nix-action@v31 | |
| with: | |
| github_access_token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: cachix/cachix-action@v16 | |
| with: | |
| name: devenv | |
| - name: Install devenv.sh | |
| run: nix profile add nixpkgs#devenv | |
| - name: Build the devenv shell and run any pre-commit hooks | |
| env: | |
| JWTINFO_TEST_AUTH0: ${{ secrets.JWTINFO_TEST_AUTH0 }} | |
| run: devenv test | |
| timeout-minutes: 15 | |
| - name: Run a single command in the devenv shell | |
| run: devenv shell run-certinfo-cert-tests | |
| go_test_coverage_check: | |
| needs: go_tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.25" | |
| - name: generate test coverage | |
| run: go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./... | |
| - name: check test coverage | |
| continue-on-error: ${{ github.ref_name != 'main' }} | |
| uses: vladopajic/go-test-coverage@v2 | |
| with: | |
| config: ./.testcoverage.yml | |
| git-token: ${{ github.ref_name == 'main' && secrets.GITHUB_TOKEN || '' }} | |
| git-branch: badges | |
| goreleaser_test: | |
| needs: devenv_test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.25" | |
| - name: Run GoReleaser test | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| version: "~> 2" | |
| args: release --snapshot --clean | |
| workdir: . |