setup: min py3.8 #200
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: CI complete testing | |
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows | |
on: # Trigger the workflow on push or pull request, but only for the main branch | |
push: | |
branches: [main] | |
pull_request: {} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
pytester: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macOS-latest, windows-latest] | |
python-version: [3.8] | |
requires: ["oldest", "latest"] | |
# Timeout: https://stackoverflow.com/a/59076067/4521646 | |
timeout-minutes: 25 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
- name: Set min. dependencies | |
if: matrix.requires == 'oldest' | |
run: | | |
for fpath in ('requirements.txt', 'tests/requirements.txt'): | |
req = open(fpath).read().replace('>=', '==') | |
open(fpath, 'w').write(req) | |
shell: python | |
- name: Install dependencies | |
run: | | |
pip install -e . -U -r tests/requirements.txt \ | |
--find-links https://download.pytorch.org/whl/cpu/torch_stable.html | |
pip list | |
- name: Tests | |
run: python -m pytest . -v --cov=challenge_xyz | |
- name: Statistics | |
run: | | |
coverage report | |
coverage xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
if: always() | |
# see: https://github.com/actions/toolkit/issues/399 | |
continue-on-error: true | |
with: | |
file: coverage.xml | |
flags: cpu,pytest,python${{ matrix.python-version }} | |
fail_ci_if_error: false | |
guardian: | |
runs-on: ubuntu-latest | |
needs: pytester | |
if: always() | |
steps: | |
- run: echo "${{ needs.pytester.result }}" | |
- name: failing... | |
if: needs.pytester.result == 'failure' | |
run: exit 1 | |
- name: cancelled or skipped... | |
if: contains(fromJSON('["cancelled", "skipped"]'), needs.pytester.result) | |
timeout-minutes: 1 | |
run: sleep 90 |