Skip to content

Experiment: use Tweag's self-hosted runners #5809

Experiment: use Tweag's self-hosted runners

Experiment: use Tweag's self-hosted runners #5809

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:
os:
- [self-hosted, Linux, X64]
- [self-hosted, macOS, ARM64]
rust_channel:
- stable
include:
- os: [self-hosted, macOS, ARM64]
continue-on-error: true
runs-on: ${{ matrix.os }}
# The `== true` makes it work wether continue-on-error has been defined or not.
continue-on-error: ${{ matrix.continue-on-error == true }}
steps:
- name: Checking out the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install cachix
id: install_cachix
run: |
set -euo pipefail
cachix_path="$(nix build --print-out-paths --inputs-from . nixpkgs#cachix.bin)"
echo "cachixBin=${cachix_path}/bin/cachix" >> "$GITHUB_OUTPUT"
- name: Setup Cachix
uses: cachix/cachix-action@v15
with:
cachixBin: ${{ steps.install_cachix.outputs.cachixBin }}
name: tweag-nickel
authToken: '${{ secrets.CACHIX_TWEAG_NICKEL_AUTH_TOKEN }}'
skipAddingSubstituter: true
- name: Run all checks
run: |
# see https://github.com/NixOS/nix/issues/8949 for why we redirect to
# an output file. Everything else is just capturing the error code
# while still printing the logs
set +e
nix flake check --accept-flake-config --print-build-logs > logs 2>&1
errcode=$?
cat logs
exit $errcode
- name: Typecheck benchmarks
run: find core/benches -type f -name "*.ncl" -print0 | xargs -0 -I file nix run . -- typecheck file
build-and-test-windows:
name: "build-and-test (windows-latest, stable)"
runs-on: windows-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- 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-*