Skip to content

Commit 1cfd468

Browse files
committed
Test executable on CI
1 parent 74e221c commit 1cfd468

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

.github/workflows/nix.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Nix CI
2+
3+
# If using Garnix, edit to run after Garnix checks using `on: check_suite`
4+
# https://garnix.io/docs/gh-actions
5+
on:
6+
push:
7+
branches: [main, lean-nix-binary]
8+
pull_request:
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
# Runs Rust tests via Nix
17+
nix-test:
18+
name: Nix Tests
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v5
22+
- uses: cachix/install-nix-action@v31
23+
with:
24+
nix_path: nixpkgs=channel:nixos-unstable
25+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
26+
- run: nix build --accept-flake-config --print-build-logs
27+
working-directory: ${{ github.workspace }}/lean
28+
- run: nix run --accept-flake-config --print-build-logs
29+
working-directory: ${{ github.workspace }}/lean
30+
31+
# Tests Nix devShell support on Ubuntu
32+
nix-devshell:
33+
name: Nix devShell Tests
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v5
37+
- uses: cachix/install-nix-action@v31
38+
with:
39+
nix_path: nixpkgs=channel:nixos-unstable
40+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
41+
# Builds and runs tests using Lake as a Nix package
42+
- run: nix develop --accept-flake-config --command bash -c "lake build && lake exe template"
43+
working-directory: ${{ github.workspace }}/lean

lean/flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
})
5555
.executable;
5656

57-
# Provide a unified dev shell with Lean + Rust
57+
# Provide a dev shell with Lean and Lake installed
5858
devShells.default = pkgs.mkShell {
5959
LEAN_SYSROOT = "${pkgs.lean.lean}";
6060
packages = with pkgs; [

0 commit comments

Comments
 (0)