Bump cirron from 0.3 to 0.4 (#192) #1757
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 | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
merge_group: | |
workflow_dispatch: | |
release: | |
types: [published] | |
schedule: | |
- cron: '0 0 1 * *' | |
jobs: | |
ci: | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.10", "3.11"] | |
poetry-version: ["1.2.2", "1.7.1"] | |
os: [ubuntu-latest] | |
include: | |
# - python-version: "3.11" | |
# poetry-version: "1.7.1" | |
# os: macos-latest | |
- python-version: "3.11" | |
poetry-version: "1.7.1" | |
os: windows-latest | |
poetry-install-extra-args: "--compile" | |
- python-version: "3.11" | |
poetry-version: "1.7.1" | |
os: ubuntu-latest | |
annotate-errors: true | |
- poetry-version: "1.7.1" | |
os: ubuntu-latest | |
poetry-install-extra-args: "--compile" | |
runs-on: ${{ matrix.os }} | |
concurrency: | |
group: ${{ github.workflow }}-${{ matrix.python-version }}-${{ matrix.poetry-version }}-${{ matrix.os }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: abatilo/actions-poetry@v3 | |
with: | |
poetry-version: ${{ matrix.poetry-version }} | |
- name: Setup a local virtual environment | |
run: | | |
poetry config virtualenvs.create true --local | |
poetry config virtualenvs.in-project true --local | |
- uses: actions/cache@v4 | |
name: Define a cache for the virtual environment based | |
with: | |
path: ./.venv | |
key: venv-${{ hashFiles('poetry.lock') }}-${{ matrix.python-version }}-${{ matrix.poetry-version }}-${{ matrix.os }}-annotate-errors=${{ matrix.annotate-errors }} | |
- name: Install the project dependencies | |
run: poetry install ${{ matrix.poetry-install-extra-args }} | |
- uses: liskin/gh-problem-matcher-wrap@v3 | |
with: | |
action: add | |
linters: flake8 | |
if: matrix.annotate-errors | |
- name: Lint with flake8 | |
run: | | |
# # < 7 to avoid ./.venv/lib/python3.11/site-packages/sympy/polys/numberfields/resolvent_lookup.py: "pyflakes[F]" failed during execution due to RecursionError('maximum recursion depth exceeded') | |
# pip install 'flake8<7' | |
# stop the build if there are Python syntax errors or undefined names | |
make git-lint | |
# exit-zero treats all errors as warnings | |
make git-lint-more FLAKE8_EXTRA_FLAGS=--exit-zero | |
- uses: liskin/gh-problem-matcher-wrap@v3 | |
with: | |
action: remove | |
linters: flake8 | |
if: matrix.annotate-errors | |
- name: Summarize lint with flake8 | |
run: | | |
printf '%s\n\n%s\n' '<details><summary><code>make git-lint-more</code></summary>' '```' >> "$GITHUB_STEP_SUMMARY" | |
make git-lint-more FLAKE8_EXTRA_FLAGS=--exit-zero >> "$GITHUB_STEP_SUMMARY" | |
printf '\n%s\n%s\n' '```' '</details>' >> "$GITHUB_STEP_SUMMARY" | |
if: always() && matrix.annotate-errors | |
- name: Remove annotations for pytest | |
run: poetry run python -m pip uninstall -y pytest-github-actions-annotate-failures | |
if: matrix.annotate-errors | |
- name: Summarize pytest results | |
run: | | |
printf '%s\n\n%s\n' '<details><summary><code>poetry run pytest -v</code></summary>' '```' >> "$GITHUB_STEP_SUMMARY" | |
poetry run pytest -v 2>&1 >> "$GITHUB_STEP_SUMMARY" | |
printf '\n%s\n%s\n' '```' '</details>' >> "$GITHUB_STEP_SUMMARY" | |
if: always() && matrix.annotate-errors | |
- name: Install annotations for pytest | |
run: poetry run python -m pip install pytest-github-actions-annotate-failures | |
if: always() && matrix.annotate-errors | |
- name: Run the automated tests | |
run: poetry run pytest -v | |
if: always() | |
- run: poetry run wandb login --anonymously | |
if: always() | |
- run: make test-load-experiments-report | |
if: always() | |
black-lint: | |
runs-on: ubuntu-latest | |
concurrency: | |
group: ${{ github.workflow }}-black-lint-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: psf/black@stable | |
with: | |
jupyter: true | |
version: "~= 24.1.1" | |
check-all: | |
runs-on: ubuntu-latest | |
needs: [ci, black-lint] | |
if: always() | |
steps: | |
- run: echo 'ci passed' | |
if: ${{ needs.ci.result == 'success' }} | |
- run: echo 'black-lint passed' | |
if: ${{ needs.black-lint.result == 'success' }} | |
- run: echo 'ci failed' && false | |
if: ${{ needs.ci.result != 'success' }} | |
- run: echo 'black-lint failed' && false | |
if: ${{ needs.black-lint.result != 'success' }} |