Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate CAPI coverage #242

Merged
merged 9 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/capi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:

- name: Install PineAPPL's C API
run: |
export RUSTFLAGS="-Cinstrument-coverage"
cargo cinstall --verbose --prefix=/usr/local/ --manifest-path pineappl_capi/Cargo.toml
ldconfig

Expand Down Expand Up @@ -39,3 +40,21 @@ jobs:
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='/.cargo/registry' \
--ignore-filename-regex='/cargo/registry' \
--ignore-filename-regex='rustc' \
--instr-profile=pineappl.profdata \
--skip-functions \
--object /usr/local/lib/libpineappl_capi.so.*.*.* \
--format lcov > lcov.info

- name: Upload to codecov.io
uses: codecov/codecov-action@v3
with:
token: ${{secrets.CODECOV_TOKEN}}
flags: capi
3 changes: 2 additions & 1 deletion maintainer/pineappl-ci/Containerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM quay.io/pypa/manylinux2014_x86_64

ARG APPLGRID_V=1.6.27
ARG CARGOC_V=0.9.14+cargo-0.67
# must be at least 0.9.16, see https://github.com/NNPDF/pineappl/pull/242#issuecomment-1705371291
ARG CARGOC_V=0.9.24+cargo-0.73.0
ARG FASTNLO_V=2.5.0-2826
ARG LHAPDF_V=6.4.0

Expand Down
8 changes: 6 additions & 2 deletions maintainer/pineappl-ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@ done
# apt update
# apt install gfortran -y

# needed by the vendored OpenSSL used by `cargo-c`
yum -y install perl-IPC-Cmd

# install cargo-c needed for the CAPI
cargo install cargo-c --version ${CARGOC_V} --features=vendored-openssl

# remove files generated by cargo
rm -r /usr/local/cargo/registry

# install LHAPDF
curl "https://lhapdf.hepforge.org/downloads/?f=LHAPDF-${LHAPDF_V}.tar.gz" | tar xzf -
# install LHAPDF - use Wayback Machine as a mirror if hepforge is offline
( curl "https://lhapdf.hepforge.org/downloads/?f=LHAPDF-${LHAPDF_V}.tar.gz" || \
curl "https://web.archive.org/web/20211018095814/https://lhapdf.hepforge.org/downloads/?f=LHAPDF-6.4.0.tar.gz" ) | tar xzf -
cd LHAPDF-${LHAPDF_V}
./configure --disable-python --disable-static
make -j
Expand Down