update readme badges #152
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: | |
- 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 |