Migration to Python3 #1433
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: "Lint and Unit Tests" | |
on: | |
push: | |
branches: [main, ] | |
pull_request: | |
# The branches below must be a subset of the branches above | |
branches: [main] | |
jobs: | |
build: | |
name: ${{ matrix.travis_job }} (Python ${{ matrix.python-version }}) | |
runs-on: ubuntu-20.04 | |
services: | |
postgres: | |
image: postgres:10.8 | |
env: | |
POSTGRES_USER: testuser | |
POSTGRES_PASSWORD: testpassword | |
POSTGRES_DB: test_django | |
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 | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [3.7] | |
travis_job: ["lint", "test"] | |
env: | |
DJANGO_SETTINGS_MODULE: esp.settings | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: niden/actions-memcached@v7 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Prepare for Installing Dependencies | |
run: deploy/travis/before_install | |
env: | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
- name: Install Dependencies for ${{ matrix.travis_job }} | |
env: | |
TRAVIS_JOB: ${{ matrix.travis_job }} | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
run: deploy/travis/install | |
- name: Prepare for ${{ matrix.travis_job }} | |
env: | |
TRAVIS_JOB: ${{ matrix.travis_job }} | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
run: deploy/travis/before_script | |
- name: Run ${{ matrix.travis_job }} | |
env: | |
TRAVIS_JOB: ${{ matrix.travis_job }} | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
run: deploy/travis/script | |
- name: Upload Coverage to Codecov | |
if: ${{ matrix.travis_job == 'test' }} | |
uses: codecov/codecov-action@v3 | |
with: | |
fail_ci_if_error: true | |
verbose: true | |
token: ${{ secrets.CODECOV_TOKEN }} |