Replace loop over insert
with splice
#12
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: | |
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/codecov-action@v3.1.4 | |
with: | |
token: ${{secrets.CODECOV_TOKEN}} | |
flags: capi |