Skip to content

Add MSHT20qed_nnlo as installed PDF in the container #1989

Add MSHT20qed_nnlo as installed PDF in the container

Add MSHT20qed_nnlo as installed PDF in the container #1989

Workflow file for this run

name: Rust
on:
push:
branches-ignore:
- pycli
- bump-pyo3-version
defaults:
run:
shell: bash
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
container: ghcr.io/nnpdf/pineappl-ci:latest
steps:
- uses: actions/checkout@v4
- name: Get test data
id: cache-test-data
uses: actions/cache@v4
with:
path: test-data
key: test-data-v17
- name: Download test data
if: steps.cache-test-data.outputs.cache-hit != 'true'
run: |
cd maintainer
./download-test-data.sh
- name: Set RUSTDOCFLAGS
run: |
# relative paths sometimes don't work, so use an absolute path
echo "RUSTDOCFLAGS=-Cinstrument-coverage -Z unstable-options --persist-doctests $(pwd)/target/debug/doctestbins" >> "$GITHUB_ENV"
- name: Run tests
env:
# `-C link-dead-code` is needed to prevent 'warning: XX functions have mismatched data' warnings
RUSTFLAGS: '-Cinstrument-coverage -Clink-dead-code'
run: |
# we need stderr, but we can't run test twice because it'll regenerate/modify the binaries which interferes with `llvm-cov`
cargo test --features=applgrid,evolve,fastnlo,fktable --no-fail-fast 2> >(tee stderr 1>&2)
# from https://stackoverflow.com/a/51141872/812178
sed -i 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g' stderr
- name: Generate code coverage
run: |
find . -name '*.profraw' -exec $(rustc --print target-libdir)/../bin/llvm-profdata merge -sparse -o pineappl.profdata {} +
( sed -nE 's/[[:space:]]+Running( unittests|) [^[:space:]]+ \(([^)]+)\)/\2/p' stderr && echo target/debug/doctestbins/*/rust_out | tr ' ' "\n" ) | \
xargs printf ' --object %s' | \
xargs $(rustc --print target-libdir)/../bin/llvm-cov export \
--ignore-filename-regex=index.crates.io \
--ignore-filename-regex=rustc \
--ignore-filename-regex=managed-lhapdf \
--ignore-filename-regex=pineappl/tests \
--ignore-filename-regex=pineappl_capi \
--ignore-filename-regex=pineappl_cli/tests \
--instr-profile=pineappl.profdata \
--skip-functions \
--object target/debug/pineappl \
--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: rust