Skip to content

Commit a7e3fb2

Browse files
jerome-benoitbalcsida
authored andcommitted
ci: add nix-eval workflow for cross-platform flake evaluation (anomalyco#12175)
1 parent 0fe0f84 commit a7e3fb2

File tree

2 files changed

+95
-46
lines changed

2 files changed

+95
-46
lines changed

.github/workflows/nix-desktop.yml.disabled

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/nix-eval.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: nix-eval
2+
3+
on:
4+
push:
5+
branches: [dev]
6+
pull_request:
7+
branches: [dev]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
nix-eval:
19+
runs-on: blacksmith-4vcpu-ubuntu-2404
20+
timeout-minutes: 15
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v6
24+
25+
- name: Setup Nix
26+
uses: nixbuild/nix-quick-install-action@v34
27+
28+
- name: Evaluate flake outputs (all systems)
29+
run: |
30+
set -euo pipefail
31+
nix --version
32+
33+
echo "=== Flake metadata ==="
34+
nix flake metadata
35+
36+
echo ""
37+
echo "=== Flake structure ==="
38+
nix flake show --all-systems
39+
40+
SYSTEMS="x86_64-linux aarch64-linux x86_64-darwin aarch64-darwin"
41+
PACKAGES="opencode"
42+
# TODO: move 'desktop' to PACKAGES when #11755 is fixed
43+
OPTIONAL_PACKAGES="desktop"
44+
45+
echo ""
46+
echo "=== Evaluating packages for all systems ==="
47+
for system in $SYSTEMS; do
48+
echo ""
49+
echo "--- $system ---"
50+
for pkg in $PACKAGES; do
51+
printf " %s: " "$pkg"
52+
if output=$(nix eval ".#packages.$system.$pkg.drvPath" --raw 2>&1); then
53+
echo "✓"
54+
else
55+
echo "✗"
56+
echo "::error::Evaluation failed for packages.$system.$pkg"
57+
echo "$output"
58+
exit 1
59+
fi
60+
done
61+
done
62+
63+
echo ""
64+
echo "=== Evaluating optional packages ==="
65+
for system in $SYSTEMS; do
66+
echo ""
67+
echo "--- $system ---"
68+
for pkg in $OPTIONAL_PACKAGES; do
69+
printf " %s: " "$pkg"
70+
if output=$(nix eval ".#packages.$system.$pkg.drvPath" --raw 2>&1); then
71+
echo "✓"
72+
else
73+
echo "✗"
74+
echo "::warning::Evaluation failed for packages.$system.$pkg"
75+
echo "$output"
76+
fi
77+
done
78+
done
79+
80+
echo ""
81+
echo "=== Evaluating devShells for all systems ==="
82+
for system in $SYSTEMS; do
83+
printf "%s: " "$system"
84+
if output=$(nix eval ".#devShells.$system.default.drvPath" --raw 2>&1); then
85+
echo "✓"
86+
else
87+
echo "✗"
88+
echo "::error::Evaluation failed for devShells.$system.default"
89+
echo "$output"
90+
exit 1
91+
fi
92+
done
93+
94+
echo ""
95+
echo "=== All evaluations passed ==="

0 commit comments

Comments
 (0)