Skip to content

Watchman Tests

Watchman Tests #803

name: Watchman Tests
# This workflow will run tests with an up-to-date production environment instead
# of the locked one.
# It will warn developers if the update of a dependency broke something.
on:
workflow_dispatch:
workflow_call:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '27 4 * * *'
jobs:
tests:
runs-on: ${{ matrix.os }}
if: ${{ !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') }}
strategy:
matrix:
python-version: [ "3.11" ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install
# Installing pytest-cov is needed because of pytest settings in pyproject.toml
run: |
pip install git+https://github.com/fast-aircraft-design/FAST-OAD.git
pip install .
pip install pytest pytest-cov nbval
shell: bash
- name: List installed packages
# List packages and versions for postmortem analysis.
run: pip list --format=freeze | tee requirements.txt
shell: bash
- uses: actions/upload-artifact@v4
with:
name: pip package list for ${{ matrix.os }}
path: requirements.txt
- name: Unit tests
run: pytest --no-cov src
shell: bash
- name: Notebook tests
if: ${{ github.event_name == 'pull_request' || contains(github.event.head_commit.message, '[test nb]') || github.ref == 'refs/heads/main' }}
run: |
pytest --no-cov --nbval-lax -p no:python src/fastoad_cs25/notebooks
shell: bash