Skip to content

build: Move cli to optional dependencies #892

build: Move cli to optional dependencies

build: Move cli to optional dependencies #892

Workflow file for this run

name: CAPI
on:
push:
branches-ignore:
- pycli
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@v3
- name: Install PineAPPL's C API
run: |
export RUSTFLAGS="-Cinstrument-coverage"
cargo cinstall --verbose --prefix=/usr/local/ --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
# version 3.1.5 upgrades to Node 20 (https://github.com/codecov/codecov-action/issues/1230), which breaks inside our container
uses: codecov/[email protected]
with:
token: ${{secrets.CODECOV_TOKEN}}
flags: capi