[EPAC-2288]: Expose bill diff deployment route #245
Workflow file for this run
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: Backend Go tests | |
| on: | |
| push: | |
| branches: [main] | |
| paths: ['backend/**'] | |
| pull_request: | |
| paths: ['backend/**'] | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| lambda: [_shared, daily-fetch, loader, members, sittings, bills, member-content, member-lobbying, member-speeches, member-speeches-publisher, member-votes, member-votes-publisher, on-this-day, estimates, lobbying, lobbying-index, riding-boundary, calendar, config, toronto-council, openapi, hansard-subjects-index, hansard-search-index, members-publisher, sittings-publisher, bills-publisher] | |
| name: Test ${{ matrix.lambda }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| # Pin to the workspace toolchain so go.work (go 1.25.3) does not force a | |
| # runtime toolchain swap, which breaks coverage with `no such tool "covdata"`. | |
| go-version-file: backend/go.work | |
| - name: Run tests with coverage | |
| working-directory: backend/${{ matrix.lambda }} | |
| run: go test -coverprofile=coverage.out ./... && go tool cover -func=coverage.out | |
| test-integration: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: epac | |
| POSTGRES_PASSWORD: epac | |
| POSTGRES_DB: epac_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: backend/go.work | |
| - name: Run integration tests | |
| working-directory: backend | |
| env: | |
| DATABASE_URL: postgresql://epac:epac@localhost:5432/epac_test?sslmode=disable | |
| run: | | |
| awk '/\.\// {print $1}' go.work | while read -r d; do | |
| echo "Testing $d..." | |
| (cd "$d" && go test -tags=integration ./...) || exit 1 | |
| done |