handle review node being null #82
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: web_api | |
| on: | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| pre_job: | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
| paths_result: ${{ steps.skip_check.outputs.paths_result }} | |
| steps: | |
| - id: skip_check | |
| uses: fkirc/skip-duplicate-actions@c449d86cf33a2a6c7a4193264cc2578e2c3266d4 # pin@v4 | |
| with: | |
| paths: '["web_api/**", ".github/workflows/**"]' | |
| test: | |
| needs: pre_job | |
| if: needs.pre_job.outputs.should_skip != 'true' | |
| runs-on: ubuntu-24.04 | |
| services: | |
| postgres: | |
| image: postgres:12 | |
| # Provide the password for postgres | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: postgres | |
| ports: | |
| - 5432:5432 | |
| # Set health checks to wait until postgres has started | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| redis: | |
| image: redis:5 | |
| # Set health checks to wait until redis has started | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| # Maps port 6379 on service container to the host | |
| - 6379:6379 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| version: "0.9.11" | |
| - name: Install dependencies | |
| working-directory: "./web_api" | |
| run: uv sync --locked --all-extras --dev | |
| - name: Set up environment variables | |
| run: echo "DATABASE_URL=postgres://postgres:postgres@127.0.0.1:5432/postgres" >> $GITHUB_ENV | |
| - name: Run tests | |
| working-directory: "web_api" | |
| run: ./s/test | |
| - name: upload code coverage | |
| working-directory: web_api | |
| run: ./s/upload-code-cov | |
| lint: | |
| needs: pre_job | |
| if: needs.pre_job.outputs.should_skip != 'true' | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| version: "0.9.11" | |
| - name: Install dependencies | |
| working-directory: "./web_api" | |
| run: uv sync --locked --all-extras --dev | |
| - name: Run lints | |
| working-directory: "web_api" | |
| run: ./s/lint | |
| squawk: | |
| needs: pre_job | |
| if: needs.pre_job.outputs.should_skip != 'true' | |
| runs-on: ubuntu-24.04 | |
| services: | |
| postgres: | |
| image: postgres:12 | |
| # Provide the password for postgres | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: web_api_test | |
| ports: | |
| - 5432:5432 | |
| # Set health checks to wait until postgres has started | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| version: "0.9.11" | |
| - name: Install dependencies | |
| working-directory: "./web_api" | |
| run: uv sync --locked --all-extras --dev | |
| - name: Run squawk | |
| working-directory: "./web_api" | |
| run: | | |
| python ./s/squawk.py | |
| - uses: sbdchd/squawk-action@v1 | |
| with: | |
| pattern: "web_api/migrations/*.sql" | |
| version: "latest" |