Skip to content

Use docker-compose for Github CI workflow #537

Use docker-compose for Github CI workflow

Use docker-compose for Github CI workflow #537

Workflow file for this run

name: Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
steps:
- uses: actions/checkout@v3
- name: Build using Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip3 install pdm
pdm self update
pdm install
- name: Run black
run: |
pdm run black --check --diff recap/ tests/
- name: Run isort
run: |
pdm run isort recap/ tests/ --check-only --diff
- name: Run autoflake
run: |
pdm run autoflake --check-diff --remove-unused-variables --remove-all-unused-imports --recursive recap/ tests/
- name: Run pylint
run: |
pdm run pylint --fail-under=7.0 recap/ tests/
- name: Run pyright
run: |
pdm run pyright
- name: Test with pytest
run: |
pdm run unit
integration-tests:
runs-on: ubuntu-latest
needs: unit-tests
strategy:
matrix:
python-version: ['3.10']
steps:
- uses: actions/checkout@v3
- name: Docker Compose Up
uses: docker/compose-action@v2
with:
args: up -d
path: tests/docker-compose.yml
- name: Build using Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip3 install pdm
pdm self update
pdm install
- name: Test with pytest
env:
RECAP_URLS: '["postgresql://postgres:password@localhost:5432/testdb"]'
run: |
pdm run integration
- name: Docker Compose Down
uses: docker/compose-action@v2
with:
args: down
path: tests/docker-compose.yml
spec-tests:
runs-on: ubuntu-latest
needs: integration-tests
strategy:
matrix:
python-version: ['3.10']
steps:
- uses: actions/checkout@v3
- name: Build using Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip3 install pdm
pdm self update
pdm install
- name: Test spec with pytest
run: |
pdm run spec