|
1 | | -name: Lint source code |
| 1 | +name: Lint and test source code |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
|
7 | 7 |
|
8 | 8 | jobs: |
9 | 9 |
|
| 10 | + |
10 | 11 | black: |
11 | 12 | runs-on: ubuntu-latest |
12 | 13 | steps: |
|
22 | 23 | runs-on: ubuntu-latest |
23 | 24 | strategy: |
24 | 25 | matrix: |
25 | | - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] |
| 26 | + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] |
26 | 27 | steps: |
27 | 28 | - uses: actions/checkout@v4 |
28 | 29 | with: |
|
39 | 40 | runs-on: ubuntu-latest |
40 | 41 | strategy: |
41 | 42 | matrix: |
42 | | - python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] |
| 43 | + python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ] |
43 | 44 | steps: |
44 | 45 | - uses: actions/checkout@v4 |
45 | 46 | with: |
|
83 | 84 |
|
84 | 85 | - name: Run isort |
85 | 86 | run : isort --profile black . |
| 87 | + |
| 88 | + |
| 89 | + unit-tests: |
| 90 | + runs-on: ubuntu-latest |
| 91 | + # From https://docs.github.com/en/actions/tutorials/use-containerized-services/create-postgresql-service-containers#configuring-the-runner-job-for-jobs-directly-on-the-runner-machine |
| 92 | + services: |
| 93 | + # Label used to access the service container |
| 94 | + postgres: |
| 95 | + # Docker Hub image |
| 96 | + image: postgres |
| 97 | + # Provide the password for postgres |
| 98 | + env: |
| 99 | + POSTGRES_PASSWORD: postgres |
| 100 | + # Set health checks to wait until postgres has started |
| 101 | + options: >- |
| 102 | + --health-cmd pg_isready |
| 103 | + --health-interval 10s |
| 104 | + --health-timeout 5s |
| 105 | + --health-retries 5 |
| 106 | + ports: |
| 107 | + # Maps tcp port 5432 on service container to the host |
| 108 | + - 5432:5432 |
| 109 | + strategy: |
| 110 | + matrix: |
| 111 | + python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ] |
| 112 | + steps: |
| 113 | + - uses: actions/checkout@v4 |
| 114 | + with: |
| 115 | + fetch-depth: 0 # Needed for versioningit to find the repo version |
| 116 | + - uses: actions/setup-python@v5 |
| 117 | + with: |
| 118 | + python-version: ${{ matrix.python-version }} |
| 119 | + |
| 120 | + - name: Install dependencies |
| 121 | + run: python -m pip install .[drf] |
| 122 | + |
| 123 | + - name: Install dependencies |
| 124 | + run: python -m pip install --upgrade pip |
| 125 | + -r requirements/requirements-dev.in |
| 126 | + -r requirements/requirements-test.in |
| 127 | + |
| 128 | + - name: Run unit tests |
| 129 | + run: python3 run_tests.py |
| 130 | + env: |
| 131 | + # The hostname used to communicate with the PostgreSQL service container |
| 132 | + POSTGRES_HOST: localhost |
| 133 | + # The default PostgreSQL port |
| 134 | + POSTGRES_PORT: 5432 |
0 commit comments