Build from refs/heads/main #850
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: Build | |
on: | |
pull_request: | |
branches: [main, develop, '**patch-release**'] | |
workflow_dispatch: | |
schedule: | |
- cron: "0 23 * * MON-FRI" | |
permissions: | |
contents: write | |
actions: write | |
pull-requests: write | |
run-name: Build from ${{ github.ref }} | |
jobs: | |
formatting-tests: | |
name: Consistency and formatting | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.x | |
uses: actions/setup-python@v5 | |
id: setup-python | |
with: | |
python-version: "3.10" | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Load cached venv | |
id: cached-pip-wheels | |
uses: actions/cache@v4 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependancies | |
if: steps.cached-pip-wheels.outputs.cache-hit != 'true' | |
run: poetry install --sync --with dev | |
- name: Static analysis tests | |
run: | | |
poetry run jupytext --sync --pipe black notebooks/scripts/*.py && git diff --exit-code | |
poetry run nbstripout --verify --extra-keys="metadata.kernelspec" notebooks/ipynb/*.ipynb | |
poetry run black --check . | |
poetry run isort --check . | |
poetry run autoflake --check . | |
poetry run pip-audit | |
unit-tests: | |
name: Unit Tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ ubuntu-22.04 ] | |
python: ["3.10", "3.11", "3.12"] | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/testing-action | |
mac-windows-tests: | |
name: Unit tests on mac and windows | |
runs-on: ${{ matrix.os }} | |
if: ${{ github.event_name == 'schedule' }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ macos-latest, windows-latest ] | |
python: ["3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/testing-action |