Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/actions/lfs-runff/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Fetch runff LFS data
description: >
Pulls only the LFS files tests/runff reads (~4 MB of the ~61 MB in LFS),
cached by object id so a run downloads nothing unless they change.
Checkout must run with `lfs: false` first.

runs:
using: composite
steps:
- name: LFS cache key
id: key
shell: bash
run: echo "key=lfs-runff-$(git lfs ls-files -l -I 'tests/runff/*' | cut -d' ' -f1,3 | git hash-object --stdin)" >> "$GITHUB_OUTPUT"

- uses: actions/cache@v4
with:
path: .git/lfs
key: ${{ steps.key.outputs.key }}

- name: Pull runff LFS data
shell: bash
run: git lfs pull --include="tests/runff/*"
4 changes: 3 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v6
with:
lfs: true
lfs: false # only tests/runff is needed, fetched below

- uses: ./.github/actions/lfs-runff

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,17 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v6
with:
lfs: true
lfs: false # only tests/runff is needed, fetched below

- uses: ./.github/actions/lfs-runff

- name: Make install script executable
run: chmod +x ./install-forefire-osx.sh

- name: Build ForeFire using macOS install script
# The LFS check would curl back the LFS files the step above skips.
env:
FOREFIRE_CHECK_LFS: "OFF"
run: ./install-forefire-osx.sh

- name: Check ForeFire version
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v6
with:
lfs: true # we use LFS to store large files (e.g. data.nc)
lfs: false # only tests/runff is needed, fetched below

- uses: ./.github/actions/lfs-runff

- name: Verify LFS test asset (data.nc)
run: |
Expand All @@ -38,7 +40,8 @@ jobs:
pip3 install --no-cache-dir lxml xarray netCDF4

- name: ForeFire build
run: sudo bash ./install-forefire.sh -y
# The LFS check would curl back the LFS files the step above skips.
run: sudo env FOREFIRE_CHECK_LFS=OFF bash ./install-forefire.sh -y

- name: Check ForeFire version
run: ./bin/forefire -v
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v6
with:
lfs: true # runff reads data.nc, which is stored in LFS
lfs: false # only tests/runff is needed, fetched below

- uses: ./.github/actions/lfs-runff

- name: Install Dependencies
run: |
Expand All @@ -53,7 +55,7 @@ jobs:
# FOREFIRE_SANITIZE also switches the compile flags to -g -O1
# -fno-omit-frame-pointer, so the stack traces are readable.
run: |
cmake -S . -B build-asan -DFOREFIRE_SANITIZE=address
cmake -S . -B build-asan -DFOREFIRE_SANITIZE=address -DFOREFIRE_CHECK_LFS=OFF
cmake --build build-asan -j"$(nproc)"

# Leaks are blocking here: the unit suite reports none since the model
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ COPY --link tools/ ./tools/
COPY --link src/ ./src/

# -march=native is off: this image is published and has to run on CPUs other
# than the builder's.
# than the builder's. The LFS check is off too: tests/ is not copied into this
# stage, so it could only fail.
#
# Only libforefireL.so is carried into the runtime stage, and the wheel build
# below compiles the core again on its own terms, so building the `forefire`
# and ANN_test executables here as well would just be a wasted compile.
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DFOREFIRE_NATIVE_ARCH=OFF \
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DFOREFIRE_NATIVE_ARCH=OFF -DFOREFIRE_CHECK_LFS=OFF \
&& cmake --build build -j"$(nproc)" --target forefireL

COPY --link bindings/ ./bindings/
Expand Down
7 changes: 7 additions & 0 deletions tools/check_all_lfs.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
set -e
set -o pipefail

# CI fetches only the LFS files its tests read (tests/runff); without this the
# check would curl the other ~57 MB back on every configure.
if [ "${FOREFIRE_CHECK_LFS:-ON}" = "OFF" ]; then
echo "LFS check skipped (FOREFIRE_CHECK_LFS=OFF)"
exit 0
fi

BASE_URL="https://github.com/forefireAPI/forefire/raw/refs/heads/master"

# File list: md5:path
Expand Down
Loading