build: do not use fmt from wrapdb #1164
Workflow file for this run
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: tests | |
on: | |
pull_request: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
tags-ignore: | |
- "*" | |
paths-ignore: | |
- .github/renovate.json | |
- readme.md | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.ref }}" | |
cancel-in-progress: true | |
jobs: | |
build: | |
uses: ./.github/workflows/_build_wheels.yaml | |
twine-check: | |
name: Check dist | |
needs: [ build ] | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: wheels-* | |
path: dist | |
merge-multiple: true | |
- run: pipx run twine check --strict dist/* | |
benchmark: | |
needs: [ build ] | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- "3.12" | |
runs-on: "ubuntu-24.04" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: wheels-* | |
path: dist | |
merge-multiple: true | |
- run: pip install -r requirements.txt | |
- run: pip install bencode2 --no-index --find-links ./dist/ | |
- name: Run benchmarks | |
uses: CodSpeedHQ/action@v3 | |
with: | |
token: ${{ secrets.CODSPEED_TOKEN }} | |
run: python -m pytest tests/bench.py --assert-pkg-compiled=true --codspeed | |
test-cp-py: | |
strategy: | |
fail-fast: false | |
max-parallel: 5 | |
matrix: | |
os: | |
- "windows-latest" | |
- "ubuntu-24.04" | |
- "macos-13" | |
- "macos-14" | |
python-version: | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
- "3.13" | |
exclude: | |
- { os: macos-14, python-version: "3.9" } | |
runs-on: "${{ matrix.os }}" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
- run: pip install -r requirements.txt | |
- run: python -m pytest --cov --assert-pkg-compiled=false | |
env: | |
PYTHONPATH: src | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
flags: "${{ matrix.python-version }}" | |
test-c-cov: | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
- "3.13" | |
runs-on: "ubuntu-24.04" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: "true" | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
- uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: llvm | |
version: 1.4 | |
- run: pip install -r requirements.txt | |
- run: meson setup build -Doptimization=0 -Dbuildtype=debug -Db_coverage=true | |
env: | |
CXX: 'clang++' | |
CXXFLAGS: "-fprofile-instr-generate -fcoverage-mapping" | |
LDFLAGS: "-fprofile-instr-generate" | |
- run: meson compile -C build | |
- run: ninja -C build copy | |
- run: pytest --cov --cov-report xml --assert-pkg-compiled=true tests | |
env: | |
PYTHONPATH: src | |
LLVM_PROFILE_FILE: "cov/code-%p.profraw" | |
- run: llvm-profdata merge -output=cov/code.profdata cov/code-*.profraw | |
- run: llvm-cov export ./src/bencode2/*.so -instr-profile=cov/code.profdata --format=lcov > coverage.info | |
- run: rm build -rf | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage.xml,coverage.info | |
flags: "${{ matrix.python-version }}" | |
test-cp-py-nogil: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
# - "windows-latest" | |
- "ubuntu-24.04" | |
# - "macos-14" | |
runs-on: "${{ matrix.os }}" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Quansight-Labs/setup-python@v5 | |
with: | |
python-version: "3.13t" | |
- run: pip install -r requirements.txt | |
- run: pytest tests --cov --cov-report xml --assert-pkg-compiled=false | |
env: | |
PYTHONPATH: src | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
files: coverage.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
test-pp: | |
strategy: | |
matrix: | |
os: | |
- "windows-latest" | |
- "ubuntu-22.04" | |
- "macos-13" | |
- "macos-14" | |
python-version: | |
- "pypy3.9" | |
- "pypy3.10" | |
runs-on: "${{ matrix.os }}" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- run: pip install -r requirements.txt | |
- run: pip install --no-build-isolation -e . | |
- name: Run pytest | |
run: python -m pytest --cov --assert-pkg-compiled=false | |
env: | |
PYTHONPATH: src | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
flags: "${{ matrix.python-version }}" | |
test-pass: | |
needs: | |
- test-pp | |
- test-cp-py | |
- benchmark | |
- test-cp-py-nogil | |
- test-c-cov | |
- twine-check | |
runs-on: "ubuntu-24.04" | |
steps: | |
- run: "echo success" |