2023-02-19 14:01:54 +01:00
|
|
|
|
|
|
|
|
2020-12-29 13:58:51 +01:00
|
|
|
name: pytest
|
|
|
|
|
|
|
|
on:
|
2023-08-17 21:55:12 +02:00
|
|
|
# Allow to manually trigger the workflow
|
|
|
|
workflow_dispatch:
|
2021-11-22 19:59:56 +01:00
|
|
|
push:
|
|
|
|
branches:
|
2022-01-30 15:02:51 +01:00
|
|
|
- master
|
2021-11-22 19:59:56 +01:00
|
|
|
pull_request:
|
2020-12-29 13:58:51 +01:00
|
|
|
schedule:
|
|
|
|
- cron: '0 8 * * *'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-12-21 22:21:42 +01:00
|
|
|
python-version: ["3.11", "3.10", "3.9"]
|
2023-08-17 21:55:12 +02:00
|
|
|
env:
|
|
|
|
PYTHONUNBUFFERED: 1
|
|
|
|
PYTHONWARNINGS: always
|
2020-12-29 13:58:51 +01:00
|
|
|
steps:
|
2023-08-17 21:55:12 +02:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
# https://github.com/marketplace/actions/checkout
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: 'fetch master and testing (for Darker/Black)'
|
2022-01-30 15:02:51 +01:00
|
|
|
run: |
|
2023-08-17 21:55:12 +02:00
|
|
|
git fetch origin master
|
|
|
|
git fetch origin testing
|
2023-02-19 14:01:54 +01:00
|
|
|
|
2020-12-29 13:58:51 +01:00
|
|
|
- name: 'Set up Python ${{ matrix.python-version }}'
|
2023-08-17 21:55:12 +02:00
|
|
|
uses: actions/setup-python@v2
|
2020-12-29 13:58:51 +01:00
|
|
|
with:
|
|
|
|
python-version: '${{ matrix.python-version }}'
|
2023-08-17 21:55:12 +02:00
|
|
|
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
# https://github.com/marketplace/actions/cache
|
|
|
|
with:
|
|
|
|
path: ~/.cache/
|
|
|
|
key: dot-cache-files
|
2022-09-13 21:08:58 +02:00
|
|
|
|
2020-12-29 13:58:51 +01:00
|
|
|
- name: 'Install package'
|
|
|
|
run: |
|
2022-12-21 22:21:42 +01:00
|
|
|
pip3 install poetry
|
2020-12-29 13:58:51 +01:00
|
|
|
make install
|
|
|
|
|
|
|
|
- name: 'List installed packages'
|
|
|
|
run: |
|
|
|
|
poetry run pip freeze
|
|
|
|
|
|
|
|
- name: 'Run tests with Python v${{ matrix.python-version }}'
|
|
|
|
run: |
|
|
|
|
make pytest
|
|
|
|
|
2022-09-15 18:16:57 +02:00
|
|
|
- name: 'Run Safety check'
|
|
|
|
run: |
|
|
|
|
make safety
|
|
|
|
|
2020-12-29 13:58:51 +01:00
|
|
|
- name: 'Upload coverage report'
|
2023-02-19 14:01:54 +01:00
|
|
|
uses: codecov/codecov-action@v3
|
|
|
|
# https://github.com/marketplace/actions/codecov
|
2022-07-22 19:40:02 +02:00
|
|
|
with:
|
|
|
|
fail_ci_if_error: false
|
|
|
|
verbose: true
|
2022-12-21 22:21:42 +01:00
|
|
|
|