From 3855b48cb258bc85e74a81aa2e4e85a8105e9c00 Mon Sep 17 00:00:00 2001 From: thomasjm Date: Fri, 30 Oct 2026 02:14:50 -0700 Subject: [PATCH] ci: run on the ARC public pools, via the nix-built test binary --- .github/actions/arc_env/action.yml | 20 ++++++++++ .github/workflows/ci.yml | 60 ++++++------------------------ flake.nix | 2 + 3 files changed, 33 insertions(+), 49 deletions(-) create mode 100644 .github/actions/arc_env/action.yml diff --git a/.github/actions/arc_env/action.yml b/.github/actions/arc_env/action.yml new file mode 100644 index 0000000..5114f92 --- /dev/null +++ b/.github/actions/arc_env/action.yml @@ -0,0 +1,20 @@ +name: "ARC environment" +runs: + using: "composite" + steps: + - name: Authenticate nix's github fetches + shell: bash + run: | + # Writing to GITHUB_ENV replaces, so preserve any existing NIX_CONFIG. + { + echo "NIX_CONFIG<> "$GITHUB_ENV" + + # Separate step: GITHUB_ENV only lands in the next one, and this eval needs the token. + - name: Set NIX_PATH from the flake's own nixpkgs + shell: bash + run: | + echo "NIX_PATH=nixpkgs=$(nix run .#nixpkgsPath)" >> "$GITHUB_ENV" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de2a44b..43746eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,63 +7,30 @@ on: workflow_dispatch: jobs: - stack: - name: stack / ghc ${{ matrix.ghc }} - runs-on: [self-hosted, Linux, desktop] + tests: + name: tests + runs-on: arc-public-medium strategy: fail-fast: false - # matrix: - # ghc: - # - "9.6.3" steps: - # - name: Install libraries - # run: | - # sudo apt update - # sudo apt install -y libzmq5-dev libpcre3-dev - - uses: actions/checkout@v4 - # - uses: haskell/actions/setup@v1 - # name: Setup Haskell Stack - # with: - # ghc-version: ${{ matrix.ghc }} - # stack-version: "latest" - # enable-stack: true - - # - uses: actions/cache@v4 - # name: Cache ~/.stack - # with: - # path: ~/.stack - # key: ${{ runner.os }}-${{ matrix.ghc }}-stack - - - name: Build - run: | - # stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks - export NIX_PATH="nixpkgs=$(nix run .#nixpkgsPath)" - echo "NIX_PATH: $NIX_PATH" - nix run .#stack -- build --nix --test --bench --no-run-tests --no-run-benchmarks + - uses: ./.github/actions/arc_env - - name: Test + - name: Run tests run: | - # stack test --system-ghc --test-arguments --print - export NIX_PATH="nixpkgs=$(nix run .#nixpkgsPath)" - echo "NIX_PATH: $NIX_PATH" - nix run .#stack -- test --nix --test-arguments --print + TESTS=$(nix build --no-link --print-out-paths .#tests)/bin/rust-notebook-language-server-test + "$TESTS" --print no-gmp: - runs-on: [self-hosted, Linux, desktop] + runs-on: arc-public-small strategy: fail-fast: false steps: - uses: actions/checkout@v4 - # - uses: cachix/install-nix-action@v22 - # with: - # nix_path: nixpkgs=channel:nixos-unstable - # extra_nix_config: | - # trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - # substituters = https://hydra.iohk.io https://cache.nixos.org/ + - uses: ./.github/actions/arc_env - name: No GMP run: | @@ -71,19 +38,14 @@ jobs: nix: name: Nix - runs-on: [self-hosted, Linux, desktop] + runs-on: arc-public-small strategy: fail-fast: false steps: - uses: actions/checkout@v4 - # - uses: cachix/install-nix-action@v22 - # with: - # nix_path: nixpkgs=channel:nixos-unstable - # extra_nix_config: | - # trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - # substituters = https://hydra.iohk.io https://cache.nixos.org/ + - uses: ./.github/actions/arc_env - name: Build run: | diff --git a/flake.nix b/flake.nix index f24bc82..ba8b05b 100644 --- a/flake.nix +++ b/flake.nix @@ -108,6 +108,8 @@ }} ''; + tests = flake.packages."rust-notebook-language-server:test:rust-notebook-language-server-test"; + nixpkgsPath = pkgs.writeShellScriptBin "nixpkgsPath.sh" "echo -n ${pkgs.path}"; });