Repository navigation
Merge pull request #94 from QCDLab/lhapdf-uncs #422
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: Run the Python-API tests 🐍 | |
| on: [push] | |
| jobs: | |
| pyapi: | |
| # `ubuntu-24.04` doesn't support Python 3.7 anymore | |
| runs-on: ubuntu-22.04 | |
| container: ghcr.io/qcdlab/neopdf-container:latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Rust 🦀 | |
| run: | | |
| rustup component add llvm-tools | |
| - name: Run the Python tests 🚀 | |
| env: | |
| # `-C link-dead-code` is needed to prevent 'warning: XX functions have mismatched data' warnings | |
| RUSTFLAGS: '-Cinstrument-coverage -Clink-dead-code' | |
| run: | | |
| cd neopdf_pyapi | |
| python3 -m venv --system-site-packages myenv | |
| . myenv/bin/activate | |
| # maturin-1.12.5 fails with: `--include-debuginfo cannot be used with --strip` | |
| pip install maturin==1.12.4 | |
| maturin develop --extras test | |
| export NEOPDF_DATA_PATH=/usr/share/LHAPDF | |
| pytest --verbose --mpl | |
| # from https://github.com/NNPDF/pineappl/blob/master/.github/workflows/python.yml | |
| find . -name '*.profraw' -exec $(rustc --print target-libdir)/../bin/llvm-profdata merge -sparse -o neopdf.profdata {} + | |
| $(rustc --print target-libdir)/../bin/llvm-cov export \ | |
| --ignore-filename-regex=index.crates.io \ | |
| --ignore-filename-regex=rustc \ | |
| --instr-profile=neopdf.profdata \ | |
| --skip-functions \ | |
| --object myenv/lib/python*/site-packages/neopdf/neopdf.*.so \ | |
| --format lcov > lcov.info | |
| grep SF lcov.info | sort -u | sed 's/SF://' | |
| - name: Upload to codecov.io | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: python |