-
Notifications
You must be signed in to change notification settings - Fork 488
93 lines (77 loc) · 2.88 KB
/
build.yml
File metadata and controls
93 lines (77 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: "Build"
on:
workflow_call:
inputs:
ref:
description: "Git ref to checkout"
required: false
type: string
system:
description: "System to build for"
required: true
type: string
runs-on:
description: "Runner to use"
required: true
type: string
jobs:
build:
runs-on: ${{ fromJSON(inputs.runs-on) }}
outputs:
devenv-path: ${{ steps.build-devenv.outputs.path }}
steps:
- uses: actions/checkout@v5
with:
ref: ${{ inputs.ref }}
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Configure Cachix
uses: cachix/cachix-action@v17
with:
name: devenv
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
# Build and cache the devenv-tasks binary used by the module system
- name: Build devenv-tasks-${{ inputs.system }}
run: |
nix build -L --show-trace --print-out-paths --system ${{ inputs.system }} .#devenv-tasks
- name: Build devenv-${{ inputs.system }}
id: build-devenv
run: |
devenv_path=$(nix build -L --show-trace --print-out-paths --system ${{ inputs.system }} .#devenv)
echo "path=$devenv_path" >> $GITHUB_OUTPUT
extended-tests:
needs: [build]
runs-on: ${{ fromJSON(inputs.runs-on) }}
steps:
- uses: actions/checkout@v5
with:
ref: ${{ inputs.ref }}
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Configure Cachix
uses: cachix/cachix-action@v17
with:
name: devenv
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
# Rebuild devenv (Cachix cache hit) so the store path is available locally.
# The build job's output is just a path string that may have been garbage collected.
- name: Build devenv
id: build-devenv
run: |
devenv_path=$(nix build -L --print-out-paths --system ${{ inputs.system }} .#devenv)
echo "path=$devenv_path" >> $GITHUB_OUTPUT
# Run feature-gated tests that can't run in the Nix sandbox (package.nix check phase):
# - test-nix-store: Nix store access (devenv-nix-backend)
# - test-pty: PTY/devpts (devenv-reload, devenv-shell)
# - test-mcp: MCP integration (devenv)
# - test-file-watcher: file watching (devenv-processes)
# nextest runs each test in a separate process, avoiding Nix C++ FFI global state issues
- name: Run integration tests
run: |
${{ steps.build-devenv.outputs.path }}/bin/devenv --system ${{ inputs.system }} shell -- cargo nextest run -j 4 --features devenv/test-all --retries 3