Skip to content

⬆️🪝 update pre-commit hooks #830

⬆️🪝 update pre-commit hooks

⬆️🪝 update pre-commit hooks #830

Workflow file for this run

name: Python
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
env:
FORCE_COLOR: 3
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
python-tests:
name: 🐍 ${{ matrix.python-version }} Tests on ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
include:
- runs-on: macos-latest
python-version: 3.8
- runs-on: macos-latest
python-version: 3.11
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
with:
prepend_symlinks_to_path: false
windows_compile_environment: msvc
override_cache_key: python-tests-${{ matrix.runs-on }}-${{ matrix.python-version }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install flint (Linux)
if: matrix.runs-on == 'ubuntu-latest'
run: sudo apt-get install libflint-dev
- name: Install flint (macOS)
if: matrix.runs-on == 'macos-latest'
run: |
brew install gmp mpfr ntl
git clone --branch v2.9.0 --depth 1 https://github.com/flintlib/flint2.git
cd flint2 && ./configure && make -j 3 && make install
- name: Set up mold as linker (Linux only)
uses: rui314/setup-mold@v1
- name: Test on 🐍 ${{ matrix.python-version }}
run: pipx run nox -s tests-${{ matrix.python-version }} --verbose
coverage:
name: 🐍 ${{ matrix.python-version }} Coverage
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.11"]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
with:
prepend_symlinks_to_path: false
override_cache_key: python-coverage-${{ matrix.python-version }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: sudo apt-get install libflint-dev
- name: Set up mold as linker (Linux only)
uses: rui314/setup-mold@v1
- name: Run session
run: pipx run nox -s tests-${{ matrix.python-version }} -- --cov --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
flags: python
token: ${{ secrets.CODECOV_TOKEN }}