Update pyproject.toml #8
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
# This workflow will install Python dependencies, run tests and lint | |
name: status | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- '**/*.toml' | |
- '**/*.py' | |
- '.github/workflows/*' | |
pull_request: | |
branches: [ main ] | |
paths: | |
- '**/*.toml' | |
- '**/*.py' | |
- '.github/workflows/*' | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
- cron: '25 9 * * 2' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
os: [ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
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 dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
pip install flake8 | |
pip install -e .[testing] | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
- name: Run pytest | |
run: pytest | |
- name: Test mu.py | |
run: | | |
pip install -e .[resources] | |
./resources/mu/mu.py -o fake/path/mymudet.pkl --plight pl_step_1000 resources/mu/mmc/ice_allm97.pklz | |
pytest -k test_pdet | |
results: | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
name: Final Results | |
needs: [build] | |
steps: | |
- run: exit 1 | |
# see https://stackoverflow.com/a/67532120/4907315 | |
if: >- | |
${{ | |
contains(needs.*.result, 'failure') | |
|| contains(needs.*.result, 'cancelled') | |
}} |