Skip to content

Update to NixOS 26.05 #752

Update to NixOS 26.05

Update to NixOS 26.05 #752

Workflow file for this run

name: "tests"
on: [push, pull_request, workflow_dispatch]
concurrency:
group: build-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
cpu-ci:
name: CPU unit tests and build
runs-on: ubuntu-24.04
steps:
- name: Checkout Git Repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Free additional space on runner
run: ./.github/workflows/helpers/free_space_on_runner.sh
- name: Install nix
uses: cachix/install-nix-action@v25
with:
github_access_token: '${{ secrets.GITHUB_TOKEN }}'
- uses: cachix/cachix-action@v14
with:
name: ff
skipPush: ${{ github.head_ref == 'master' }}
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: setup nix develop shell
uses: nicknovitski/nix-develop@v1.1.0
env:
NIXPKGS_ALLOW_UNFREE: 1
with:
arguments: ".#ci --accept-flake-config"
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
- name: Run checks
run: |
proj check cpu-ci
- name: Generate code coverage
run: |
# A toolchain mismatch between the instrumentation and libgcov makes
# every test abort profiling without writing anything, which would
# otherwise surface as a silent 0% report rather than a failure.
gcda_count="$(find build/coverage -name '*.gcda' | wc -l)"
echo "found $gcda_count .gcda files"
if [ "$gcda_count" -eq 0 ]; then
echo "::error::no coverage data was produced by the test run" >&2
exit 1
fi
# lcov 2.x treats several classes of gcov disagreement as hard
# errors; gcc emits them routinely for templates, so downgrade them.
lcov_opts=(
--rc geninfo_unexecuted_blocks=1
--ignore-errors "inconsistent,mismatch,unused,negative,source,empty"
-j "$(nproc)"
)
lcov "${lcov_opts[@]}" --capture --directory build/coverage --output-file coverage-all.info
# Paths recorded by geninfo are absolute, so anchor on $PWD rather
# than a bare 'lib/*'.
lcov "${lcov_opts[@]}" --extract coverage-all.info "$PWD/lib/*" --output-file coverage-lib.info
lcov "${lcov_opts[@]}" --remove coverage-lib.info '*.dtg.h' '*.dtg.cc' --output-file main_coverage.info
lcov "${lcov_opts[@]}" --list main_coverage.info
- name: Upload code coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: main_coverage.info
# We hand codecov the one report we generated above; without these it
# searches the tree and runs its gcov plugin over the whole build.
disable_search: true
plugins: noop
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
verbose: true
gpu-ci:
name: GPU unit tests
needs: cpu-ci
runs-on:
- runs-on=${{ github.run_id }}
- family=g4dn.xlarge
- image=flexflow-gpu-ci
strategy:
max-parallel: 1
fail-fast: false
steps:
- name: checkout git repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: mount ephemeral drive to nix
run: |
sudo mkdir $HOME/_work/nix && sudo mkdir /nix && sudo mount --bind $HOME/_work/nix /nix
- name: install nix
uses: cachix/install-nix-action@v25
with:
github_access_token: '${{ secrets.GITHUB_TOKEN }}'
- uses: cachix/cachix-action@v14
with:
name: ff
skipPush: true
# authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: setup nix develop shell
uses: nicknovitski/nix-develop@v1.1.0
env:
NIXPKGS_ALLOW_UNFREE: 1
with:
arguments: ".#gpu-ci --accept-flake-config --impure"
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
- name: Run checks
run: |
proj check gpu-ci