Update github action versions #1009
This file contains 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: CI | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the develop branch | |
on: | |
push: | |
branches: ["develop"] | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
# Don't run, if only docs changed | |
paths-ignore: | |
- '**.md' | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
tests: | |
name: Test Suite | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Docker build | |
run: docker compose build | |
- name: Run tests | |
# Use -T parameter to avoid input device not being recognized | |
# https://github.com/docker/compose/issues/5696#issuecomment-425112003 | |
run: docker compose run -T app python manage.py test --parallel | |
- name: List running containers for debugging | |
if: always() | |
run: docker ps -a | |
- name: Show logs for debugging | |
if: always() | |
run: docker compose logs -t | |
coverage: | |
name: Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Docker build | |
run: docker compose build | |
- name: Collect coverage | |
# Use -T parameter to avoid input device not being recognized | |
# https://github.com/docker/compose/issues/5696#issuecomment-425112003 | |
run: docker compose run -T app scripts/coverage.sh | |
- uses: codecov/codecov-action@v2 | |
with: | |
file: ./coverage.xml | |
run-linters: | |
name: Run linters | |
runs-on: ubuntu-latest | |
# Linters are not run on PRs created by dependabot because these runs lack | |
# the secret required to create Github Status Checks and will not have new | |
# linter issues anyway. | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.9 | |
- name: Install Python dependencies | |
run: pip install black | |
- name: Run linters | |
uses: wearerequired/lint-action@v1 | |
with: | |
github_token: ${{ secrets.github_token }} | |
# Enable linters | |
black: true |