Skip to content

CI

CI #463

Workflow file for this run

name: CI
on:
push:
paths-ignore:
- '.cookiecutter/*'
- '.github/dependabot.yml'
- 'bin/make_python'
- 'bin/make_template'
- 'docs/*'
- '**/.gitignore'
- 'LICENSE'
- '*.md'
- 'docker-compose.yml'
workflow_dispatch:
workflow_call:
schedule:
- cron: '0 1 * * *'
jobs:
Format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: python -m pip install 'tox<4'
- run: tox -e checkformatting
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: python -m pip install 'tox<4'
- run: tox -e lint
Tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11.5-alpine
ports:
- 5439:5432
env:
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
python-version: ['3.10', '3.9', '3.8', '3.7']
name: Unit tests with Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Create test database
run: psql -U postgres -h localhost -p 5439 -c 'CREATE DATABASE data_tasks_tests'
- run: python -m pip install 'tox<4'
- run: tox -e tests
env:
COVERAGE_FILE: .coverage.${{ matrix.python-version }}
- name: Upload coverage file
uses: actions/upload-artifact@v3
with:
name: coverage
path: .coverage.*
Coverage:
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Download coverage files
uses: actions/download-artifact@v3
with:
name: coverage
- run: python -m pip install 'tox<4'
- run: tox -e coverage
Functests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11.5-alpine
ports:
- 5439:5432
env:
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
python-version: ['3.10', '3.9', '3.8', '3.7']
name: Functional tests with Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Create test database
run: psql -U postgres -h localhost -p 5439 -c 'CREATE DATABASE data_tasks_functests'
- run: python -m pip install 'tox<4'
- run: tox -e functests