Merge remote-tracking branch 'origin/Feature/coassembly-schema' into … #2572
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: Testing | |
| on: [push, pull_request] # yamllint disable-line rule:truthy | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| services: | |
| db: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_DB: test_emg | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| ports: | |
| - "5432:5432" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.12 | |
| - uses: pre-commit/action@v3.0.1 | |
| - name: Build Docker image | |
| run: | | |
| docker build --target ci -t app:latest . | |
| - name: Check for unmigrated code | |
| run: | | |
| docker run --rm app:latest python manage.py makemigrations --check | |
| - name: Run tests | |
| run: | | |
| docker run -v ${{ github.workspace }}/coverage:/app/coverage \ | |
| -v ${{ github.workspace }}/slurm-dev-environment/fs/nfs/public:/app/data \ | |
| --entrypoint bash \ | |
| --add-host=host.docker.internal:host-gateway \ | |
| -e DATABASE_URL=postgres://postgres:postgres@host.docker.internal:5432/emg --rm app:latest -c pytest | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: coverage/coverage.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| # Debugging info: | |
| # This workflow file also works offline, using https://github.com/nektos/act. | |
| # Tested on Apple M series, with Colima. |