Skip to content

Swap unwrap_or for unwrap_or_default #1045

Swap unwrap_or for unwrap_or_default

Swap unwrap_or for unwrap_or_default #1045

Workflow file for this run

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
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
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: capi