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
20 changes: 20 additions & 0 deletions .github/actions/arc_env/action.yml
Original file line number Diff line number Diff line change
@@ -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<<NIX_CONFIG_EOF"
if [[ -n "${NIX_CONFIG:-}" ]]; then echo "$NIX_CONFIG"; fi
echo "access-tokens = github.com=${{ github.token }}"
echo "NIX_CONFIG_EOF"
} >> "$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"
60 changes: 11 additions & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,83 +7,45 @@ 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: |
nix run .#verify-no-gmp

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: |
Expand Down
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
});

Expand Down
Loading