Repository navigation
Implement scale variations #36
This file contains hidden or 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: Test core APIs 💻 | |
| on: | |
| push: | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| env: | |
| PINEAPPL_VERSION: 1.3.2 | |
| APFELXX_BRANCH: QED | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential cmake pkg-config libyaml-cpp-dev | |
| # ---- Cache local installs (.local) ---- | |
| - name: Cache PineAPPL and APFEL++ | |
| id: cache-local | |
| uses: actions/cache@v4 | |
| with: | |
| path: $HOME/.local | |
| key: > | |
| ${{ runner.os }}-local- | |
| pineappl-${{ env.PINEAPPL_VERSION }}- | |
| apfelxx-${{ env.APFELXX_BRANCH }}- | |
| ${{ hashFiles('.github/workflows/ci.yml') }} | |
| # ---- Install PineAPPL C API (if not cached) ---- | |
| - name: Install PineAPPL C API | |
| if: steps.cache-local.outputs.cache-hit != 'true' | |
| run: | | |
| curl -fL --retry 5 --retry-delay 2 --retry-connrefused https://nnpdf.github.io/pineappl/install-capi.sh -o install.sh | |
| sh install.sh --prefix "$HOME/.local" --version $PINEAPPL_VERSION | |
| # ---- Build APFEL++ from source (if not cached) ---- | |
| - name: Build and install APFEL++ | |
| if: steps.cache-local.outputs.cache-hit != 'true' | |
| run: | | |
| git clone --branch $APFELXX_BRANCH https://github.com/vbertone/apfelxx.git /tmp/apfelxx | |
| cd /tmp/apfelxx | |
| mkdir build && cd build | |
| cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.local | |
| make -j$(nproc) | |
| make install | |
| - name: Export local paths | |
| run: | | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| echo "PKG_CONFIG_PATH=$HOME/.local/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV | |
| echo "LD_LIBRARY_PATH=$HOME/.local/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV | |
| # ---- Build pineapfel ---- | |
| - name: Build pineapfel | |
| run: | | |
| mkdir build | |
| cd build | |
| cmake .. | |
| make -j$(nproc) | |
| # ---- Test: Grid vs APFEL++ comparison ---- | |
| - name: Test grid vs APFEL++ comparison | |
| run: | | |
| cd build | |
| ctest --output-on-failure | |
| # ---- Test: CLI usage message ---- | |
| - name: Test CLI usage | |
| run: | | |
| ./build/pineapfel-evolve 2>&1 | grep -q "Usage:" || (echo "CLI usage message not found" && exit 1) | |
| # ---- Test: Evolve a grid ---- | |
| - name: Test grid evolution | |
| run: | | |
| ./build/pineapfel-evolve test-data/LHCB_WP_7TEV_opt.pineappl.lz4 runcards/theory.yaml runcards/operator.yaml -o /tmp/test_fktable.pineappl.lz4 | |
| test -f /tmp/test_fktable.pineappl.lz4 || (echo "FK table was not produced" && exit 1) |