Skip slow tests except for scheduled jobs #1852
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] | |
schedule: | |
- cron: "0 4 * * *" | |
jobs: | |
pytest: | |
name: Unit tests | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | |
exclude: # run only latest Python on Windows and macOS | |
- os: macos-latest | |
python-version: '3.8' | |
- os: macos-latest | |
python-version: '3.9' | |
- os: macos-latest | |
python-version: '3.10' | |
- os: macos-latest | |
python-version: '3.11' | |
- os: windows-latest | |
python-version: '3.8' | |
- os: windows-latest | |
python-version: '3.9' | |
- os: windows-latest | |
python-version: '3.10' | |
- os: windows-latest | |
python-version: '3.11' | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
env: | |
OS: ${{ matrix.os }} | |
steps: | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install tox | |
run: pip install tox | |
- name: Run unit tests | |
run: | | |
if [ "${{ github.event_name }}" == "schedule" ]; then | |
tox -e py | |
else | |
tox -e py -- -m "no slow" | |
fi | |
- name: Upload coverage reports to Codecov | |
run: | | |
OS_LOWERCASE=$(echo $RUNNER_OS | tr '[:upper:]' '[:lower:]') | |
curl -Os https://uploader.codecov.io/latest/${OS_LOWERCASE}/codecov | |
chmod +x codecov | |
./codecov | |
cli: | |
name: CLI smoke tests | |
runs-on: ubuntu-latest | |
env: | |
PYTHON_VERSION: '3.12' | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install project | |
run: pip install . | |
- name: Test transforms CLI tool | |
run: tiotr --help | |
- name: Test info CLI tool | |
run: tiohd --help |