chore(deps-dev): bump black from 23.3.0 to 24.3.0 #219
Workflow file for this run
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: tests | |
on: | |
push: | |
branches: main | |
pull_request: | |
branches: main | |
jobs: | |
pytest: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: "1.6.1" | |
- name: Resolve dependencies | |
run: poetry export -f requirements.txt --without-hashes --with dev --output src/app/requirements.txt | |
- name: Build & run docker | |
env: | |
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
TELEGRAM_TEST_CHAT_ID: ${{ secrets.TELEGRAM_TEST_CHAT_ID }} | |
run: docker compose -f docker-compose.test.yml up -d --build | |
- name: "Create local AWS environment" | |
run: | | |
docker compose exec localstack awslocal s3 mb s3://sample-bucket | |
docker compose exec localstack awslocal s3api put-object --bucket sample-bucket --key media-folder | |
- name: Run docker test | |
run: | | |
docker compose -f docker-compose.test.yml exec -T backend pytest --cov=app --cov-report xml tests/ | |
docker compose -f docker-compose.test.yml cp backend:/app/coverage.xml ./coverage-src.xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage-src.xml | |
flags: unittests | |
fail_ci_if_error: true | |
pytest-client: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python: [3.9] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
architecture: x64 | |
- uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: "1.6.1" | |
- name: Resolve dependencies | |
run: poetry export -f requirements.txt --without-hashes --output src/app/requirements.txt | |
- name: Build & run API server | |
run: | | |
docker volume prune -f | |
docker compose up -d --build | |
docker ps | |
- name: Cache python modules | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-python-${{ matrix.python }}-${{ hashFiles('client/pyproject.toml') }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e "client/.[test]" | |
- name: Run client unittests | |
run: | | |
sleep 15 | |
cd client && pytest --cov=pyroclient --cov-report xml tests/ -n auto | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./client/coverage.xml | |
flags: client | |
fail_ci_if_error: true | |
headers: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
- name: Check the headers | |
uses: frgfm/validate-python-headers@main | |
with: | |
license: 'Apache-2.0' | |
owner: 'Pyronear' | |
starting-year: 2020 | |
folders: 'src,client,.github' | |
ignore-files: 'version.py,__init__.py' | |
ignore-folders: 'client/tests/,src/tests/,src/alembic/versions/' |