[Snyk] Security upgrade django from 2.2.16 to 3.2.25 #506
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: backend | |
on: pull_request | |
jobs: | |
backend: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
toxenv: | |
- lint-current | |
- validate-migrations | |
- validate-assets | |
- validate-translations | |
- unittest-current | |
- unittest-future | |
services: | |
postgres: | |
# https://help.github.com/en/actions/configuring-and-managing-workflows/creating-postgresql-service-containers | |
# https://github.com/actions/example-services/blob/master/.github/workflows/postgres-service.yml | |
image: postgres | |
env: | |
POSTGRES_USER: cfpb | |
POSTGRES_PASSWORD: cfpb | |
POSTGRES_DB: cfgov | |
ports: | |
- 5432:5432 | |
# needed because the postgres container does not provide a healthcheck | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- uses: actions/checkout@v2 | |
# Make sure we have gettext installed for the translation validation | |
- run: | | |
sudo apt-get install gettext | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.6 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements/ci.txt | |
- name: Run tox -e ${{ matrix.toxenv }} | |
run: | | |
tox -e ${{ matrix.toxenv }} | |
env: | |
TEST_RUNNER: core.testutils.runners.StdoutCapturingTestRunner | |
- name: Prepare test coverage | |
if: matrix.toxenv == 'unittest-current' | |
run: coverage xml | |
- name: Store test coverage | |
# Submit coverage from our prefered tox run only | |
if: matrix.toxenv == 'unittest-current' | |
uses: actions/upload-artifact@v1 | |
with: | |
name: backend_coverage | |
path: ./coverage.xml | |
coverage: | |
runs-on: ubuntu-latest | |
needs: | |
- backend | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.6 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements/ci.txt | |
- name: Retrieve backend coverage | |
uses: actions/download-artifact@v1 | |
with: | |
name: backend_coverage | |
- name: Check backend test coverage | |
run: | | |
diff-cover backend_coverage/coverage.xml --compare-branch=origin/main --fail-under=100 |