feat(lint): add ruff lint to CI and pre-commit hook #27
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: Run Tests | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Lint | |
| run: make lint CHECK=1 | |
| tests: | |
| runs-on: ubuntu-24.04 | |
| services: | |
| postgres: | |
| image: postgres:18 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: postgres | |
| ports: | |
| - 5432:5432 | |
| # The official postgres image does not expose a default Docker HEALTHCHECK, | |
| # so we define one explicitly for the GitHub Actions service container. | |
| options: >- | |
| --health-cmd "pg_isready -U postgres" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| env: | |
| E2E_PG_HOST: 127.0.0.1 | |
| E2E_PG_PORT: 5432 | |
| E2E_PG_USER: postgres | |
| E2E_PG_PASSWORD: postgres | |
| E2E_PG_DB: postgres | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y postgresql-client | |
| make install-test | |
| - name: Run tests | |
| run: | | |
| make test |