Skip to content

Merge pull request #2506 from nickel-lang/dependabot/cargo/bytes-1.11.1 #7717

Merge pull request #2506 from nickel-lang/dependabot/cargo/bytes-1.11.1

Merge pull request #2506 from nickel-lang/dependabot/cargo/bytes-1.11.1 #7717

name: Continuous integration
on:
push:
branches:
- master
pull_request:
merge_group:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
strategy:
matrix:
include:
- os: ubuntu-24.04
name: linux
- os: macos-15
name: macos
name: build-and-test (${{ matrix.name }})
runs-on: ${{ matrix.os }}
steps:
- name: Checking out the repository
uses: actions/checkout@v6
with:
fetch-depth: 0
# Last I checked, the ubuntu runners have a root filesystem with 23G free
# and a /mnt with 66G free. Putting /nix in /mnt seems to stop us from
# running out of disk space. (There are also actions available that do
# more drastic things.)
- name: Loop mount
if: runner.os == 'Linux'
run: |
sudo mkdir /mnt/nix
sudo mkdir /nix
sudo mount --bind /mnt/nix /nix
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
experimental-features = nix-command flakes
accept-flake-config = true
keep-outputs = true
keep-derivations = true
- name: Nix cache
uses: nix-community/cache-nix-action@v7
with:
primary-key: ci-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
restore-prefixes-first-match: ci-${{ runner.os }}-
purge: true
# This was the only way I could figure out to stop cache-nix-action from
# purging the cache that it just created. The "purge: true" above makes
# it purge the old cache just before trying to save a new one. This line
# makes it not purge anything after saving.
purge-prefixes: non-existent-prefix-
- name: Run all checks
run: |
# This is basically `nix flake check`, except that it creates extra GC
# roots. Then we run a GC to get rid of anything that's unlikely to be
# useful to cache.
SYSTEM=$(nix eval --impure --raw --expr builtins.currentSystem)
nix eval .#checks.${SYSTEM} --apply builtins.attrNames --json \
| jq -r '.[]' \
| xargs -I {} nix build .#checks.${SYSTEM}.{} --out-link .check-{} --print-build-logs
nix store gc
# FIXME: this is broken right now: we don't have nickel installed. And I think
# maybe we'd prefer to use the nickel we just built? Anyway, it was already broken
# so we'll fix it later.
- name: Typecheck benchmarks
run: find core/benches -type f -name "*.ncl" -exec nickel typecheck '{}' \;
build-and-test-windows:
name: "build-and-test (windows-latest)"
runs-on: windows-latest
continue-on-error: true
steps:
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Build
run: cargo build --all-targets --package nickel-lang-*
- name: Test
run: cargo test --package nickel-lang-*