Skip to content

fix lint failing silently #153

fix lint failing silently

fix lint failing silently #153

Workflow file for this run

name: CI
on:
- release
- push
- pull_request
jobs:
lint:
name: Run lint checks
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: "3.11"
cache: true
- name: Install dependencies
run: pdm sync -d -G lint
- name: Run lint checks
run: pdm run lint
test:
name: Run tests
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
# Versions available:
# pypy: https://downloads.python.org/pypy/versions.json
# Python: https://github.com/actions/python-versions/blob/main/versions-manifest.json
# Additional info: https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md
# OS images: https://github.com/actions/runner-images
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
architecture:
- x86
- x64
platform:
- ubuntu-20.04
- windows-latest
# Fix tests failing on MacOS 14+ due to ARM architecture
# https://github.com/actions/setup-python/issues/825
# TODO: update tests to use ARM MacOS with 14+, add
# architecture to the list of architectures above.
- macos-13
exclude:
- platform: ubuntu-20.04
architecture: x86
- platform: macos-13
architecture: x86
steps:
- uses: actions/checkout@v4
- name: Setup PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- name: Display platform and environment information
run: |
python --version
pdm run python --version
python -c "import sys; print('sys.version: %s' % str(sys.version))"
python -c "import sys; print('sys.platform: %s' % str(sys.platform))"
python -c "import os; print('os.name: %s' % str(os.name))"
python -c "import platform; print('platform.uname(): %s' % str(platform.uname()))"
- name: Install dependencies
run: pdm sync -d -G test,ci
# TODO: fix benchmark results (maybe a separate Job?)
- name: Run tests
run: pdm run test
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
- name: Coveralls
if: ${{ matrix.platform == 'ubuntu-20.04' && github.event_name != 'pull_request' }}
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true
flag-name: ${{ matrix.python-version }}-${{ matrix.platform }}
coveralls_finish:
needs: test
runs-on: ubuntu-20.04
steps:
- name: Coveralls Finished
if: ${{ github.event_name != 'pull_request' }}
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
# TODO: publish releases using CI
# TODO: don't publish pre-releases OR publish them as pre-releases to PyPI
# https://docs.pypi.org/trusted-publishers/adding-a-publisher/
# https://pdm-project.org/en/latest/usage/publish/
# name: "Build and publish a release"
# on:
# release:
# types: [released]
# jobs:
# pypi-publish:
# name: Publish release to PyPI
# runs-on: "ubuntu-22.04"
# permissions:
# # This permission is needed for private repositories.
# contents: read
# # IMPORTANT: this permission is mandatory for trusted publishing
# id-token: write
# steps:
# - uses: actions/checkout@v4
# - name: Setup PDM
# uses: pdm-project/setup-pdm@v4
# with:
# python-version: "3.11"
# - name: Publish package distributions to PyPI
# run: pdm publish