[pre-commit.ci] pre-commit autoupdate #201
This file contains hidden or 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: Test | |
| on: [push, pull_request] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
| python-version: ["3.8", "3.13"] | |
| name: Test (${{ matrix.python-version }}, ${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # Full history is required for setuptools-scm to determine version | |
| fetch-depth: 0 | |
| - uses: mamba-org/setup-micromamba@v1 | |
| with: | |
| environment-file: environment.yml | |
| create-args: python=${{ matrix.python-version }}.* | |
| - name: Install cutde | |
| run: | | |
| pip install --no-deps --disable-pip-version-check -e . | |
| pip check | |
| - name: Test | |
| run: | | |
| CFLAGS='-stdlib=libc++' pytest --runslow --cov=./ --cov-report=xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v1 | |
| with: | |
| fail_ci_if_error: false | |
| check-readme: | |
| name: Check README.md is up-to-date | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| - name: Install dependencies | |
| run: | | |
| pip install mako | |
| - name: Generate README.md | |
| run: | | |
| docs/build_readme --ensure-gh-md-toc | |
| - name: Check if files are up-to-date | |
| run: | | |
| if ! git diff --quiet README.md; then | |
| echo "ERROR: README.md is not up-to-date!" | |
| echo "Differences found in README.md:" | |
| git diff README.md | |
| exit 1 | |
| fi | |
| check-example-image: | |
| name: Check docs/example.png is up-to-date | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # Full history is required for setuptools-scm to determine version | |
| fetch-depth: 0 | |
| - uses: mamba-org/setup-micromamba@v1 | |
| with: | |
| environment-file: environment.yml | |
| - name: Install cutde | |
| run: | | |
| pip install --no-deps --disable-pip-version-check -e . | |
| pip check | |
| - name: Generate example.png | |
| run: | | |
| # Save the original file before generating the new one | |
| cp docs/example.png docs/example.png.original | |
| python docs/example.py | |
| - name: Check if files are up-to-date | |
| run: | | |
| # Compare the newly generated file with the original one | |
| python docs/_compare_png.py docs/example.png.original docs/example.png | |
| if [ $? -ne 0 ]; then | |
| echo "" | |
| echo "The newly generated docs/example.png has been uploaded as an artifact." | |
| echo "You can download it from the Actions tab and commit it to update the repository." | |
| exit 1 | |
| fi | |
| - name: Upload generated example.png as artifact | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: generated-example-png | |
| path: docs/example.png |