Complete final missing PyInterface
and make tests more Robust
#1221
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: CAPI | |
on: | |
push: | |
branches-ignore: | |
- pycli | |
- bump-pyo3-version | |
jobs: | |
capi: | |
runs-on: ubuntu-latest | |
container: ghcr.io/nnpdf/pineappl-ci:latest | |
steps: | |
# checkout@v4 uses a newer version of Node that's incompatible with our container's GLIBC | |
- uses: actions/checkout@v4 | |
- name: Install PineAPPL's C API | |
env: | |
# `-C link-dead-code` is needed to prevent 'warning: XX functions have mismatched data' warnings | |
RUSTFLAGS: '-Cinstrument-coverage -Clink-dead-code' | |
run: | | |
cargo cinstall --verbose --prefix=/usr/local/ --libdir=lib --manifest-path pineappl_capi/Cargo.toml | |
ldconfig | |
- name: Test C++ example | |
run: | | |
cd examples/cpp | |
# if `make` is too old, it doesn't support the `!=` operator | |
sed -i "s/\([a-zA-Z_]\+\) != \(.*\)$/echo \1 = \$(\2)/e" Makefile | |
make test-examples | |
- name: Test Fortran example | |
run: | | |
cd examples/fortran | |
sed -i "s/\([a-zA-Z_]\+\) != \(.*\)$/echo \1 = \$(\2)/e" Makefile | |
make | |
./dyaa | |
test -f ./DY-LO-AA.pineappl.lz4 | |
- name: Test OO C++ example | |
run: | | |
cd examples/object-oriented-cpp | |
sed -i "s/\([a-zA-Z_]\+\) != \(.*\)$/echo \1 = \$(\2)/e" Makefile | |
make | |
./dyaa | |
test -f ./DY-LO-AA.pineappl.lz4 | |
- name: Generate code coverage | |
run: | | |
find . -name '*.profraw' -exec $(rustc --print target-libdir)/../bin/llvm-profdata merge -sparse -o pineappl.profdata {} + | |
$(rustc --print target-libdir)/../bin/llvm-cov export \ | |
--ignore-filename-regex='index.crates.io' \ | |
--ignore-filename-regex='rustc' \ | |
--instr-profile=pineappl.profdata \ | |
--skip-functions \ | |
--object /usr/local/lib/libpineappl_capi.so.*.*.* \ | |
--format lcov > lcov.info | |
# print all files for which coverage has been generated | |
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: capi |