You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.4 KiB
YAML
58 lines
1.4 KiB
YAML
name: test
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
schedule:
|
|
- cron: "00 16 07 * *" # = monthly
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10", "3.11" ]
|
|
|
|
env:
|
|
test_results_dir: test-results-${{ matrix.python-version }}
|
|
|
|
steps:
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Update pip
|
|
run: python3 -m pip install -U pip
|
|
- name: Install requirements*.txt
|
|
run: |
|
|
for requirements_txt in requirements*.txt; do
|
|
python3 -m pip install -r $requirements_txt;
|
|
done
|
|
|
|
- name: Test
|
|
run: |
|
|
cd src
|
|
mkdir -p ../$test_results_dir
|
|
python3 -m pytest --junitxml=../$test_results_dir/junit.xml -o junit_family=legacy
|
|
- name: Upload test results
|
|
uses: actions/upload-artifact@v3
|
|
if: success() || failure()
|
|
with:
|
|
name: ${{ env.test_results_dir }}
|
|
path: ${{ env.test_results_dir }}
|
|
|
|
- name: Report tests
|
|
uses: dorny/test-reporter@v1
|
|
if: success() || failure()
|
|
with:
|
|
name: Results on Python ${{ matrix.python-version }}
|
|
path: "${{env.test_results_dir }}/junit.xml"
|
|
reporter: java-junit
|