Repository navigation
fix allowlist case-insensitive lookup (#642) #1342
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: Go Tests | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up Go | |
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version: '1.26.2' | |
| - name: Export Go module cache path | |
| run: echo "GOMODCACHE=$(go env GOMODCACHE)" >> "$GITHUB_ENV" | |
| - name: Restore module cache | |
| id: modcache | |
| uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: ${{ env.GOMODCACHE }} | |
| key: ${{ runner.os }}-gomod-${{ hashFiles('**/go.sum') }} | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Vet code | |
| run: go vet ./... | |
| - name: Lint (optional) | |
| run: | | |
| if command -v golangci-lint >/dev/null 2>&1; then | |
| golangci-lint run | |
| else | |
| echo "golangci-lint not installed, skipping" | |
| fi | |
| - name: Check formatting | |
| run: test -z "$(gofmt -l .)" | |
| - name: Run tests with coverage | |
| run: go test -coverprofile=coverage.out ./... | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5.5.4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Save module cache | |
| uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| if: ${{ steps.modcache.outputs.cache-hit != 'true' }} | |
| with: | |
| path: ${{ env.GOMODCACHE }} | |
| key: ${{ runner.os }}-gomod-${{ hashFiles('**/go.sum') }} |