fix: test #195
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 Test | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| integration-scenarios-contract-guard: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Verify integration scenarios contract coverage | |
| run: .github/scripts/check_integration_scenarios_contract.sh | |
| integration-matrix-guard: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Ensure integration matrix covers all required backends | |
| run: | | |
| set -euo pipefail | |
| matrix_line="$(awk '/backend: \[/{print; exit}' .github/workflows/test.yml)" | |
| test -n "$matrix_line" | |
| for backend in null sync workerpool redis mysql postgres sqlite nats sqs rabbitmq; do | |
| if ! echo "$matrix_line" | grep -Eq "(^|[^a-z])${backend}([^a-z]|$)"; then | |
| echo "missing required integration backend in matrix: ${backend}" | |
| exit 1 | |
| fi | |
| done | |
| unit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "stable" | |
| - name: Install dependencies | |
| run: go mod download | |
| - name: Verify curated README manual snippets compile | |
| run: ./scripts/check-readme-snippets.sh | |
| - name: Verify generated examples compile | |
| working-directory: examples | |
| run: go test ./... -run TestExamplesBuild -count=1 | |
| - name: Run unit tests | |
| run: go test ./... -v | |
| - name: Run unit tests with coverage | |
| run: ./scripts/coverage-codecov.sh | |
| - name: Upload results to Codecov | |
| uses: codecov/codecov-action@v5 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| race: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "stable" | |
| - name: Install dependencies | |
| run: go mod download | |
| - name: Run race tests (root module scope) | |
| run: go test -race ./... | |
| integration-all: | |
| needs: [integration-matrix-guard, integration-scenarios-contract-guard] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| backend: [null, sync, workerpool, redis, mysql, postgres, sqlite, nats, sqs, rabbitmq] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "stable" | |
| - name: Install dependencies | |
| run: go mod download | |
| - name: Run integration tests | |
| env: | |
| INTEGRATION_BACKEND: ${{ matrix.backend }} | |
| run: go test -p=1 -tags integration ./integration/... |