Skip to content

Commit 358f2ff

Browse files
committed
tests: migrate all vm tests to sandbox
- use vagrant boxes as image sources - run this inside an +__impure derivation to allow network access - re-introduce test for fedora
1 parent 1e64a18 commit 358f2ff

10 files changed

+798
-356
lines changed

.github/workflows/nix-portable.yml

+113-67
Original file line numberDiff line numberDiff line change
@@ -5,94 +5,140 @@ on:
55
workflow_dispatch:
66
push:
77
branches: [ "ci", "main" ]
8-
jobs:
9-
108

9+
jobs:
1110

12-
build:
11+
nix-matrix:
1312
runs-on: ubuntu-latest
14-
continue-on-error: true
13+
outputs:
14+
matrix: ${{ steps.set-matrix.outputs.matrix }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: cachix/install-nix-action@v30
18+
- id: set-matrix
19+
name: Generate Nix Matrix
20+
run: |
21+
set -Eeu
22+
matrix="$(nix eval --json '.#githubActions.matrix')"
23+
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
24+
25+
nix-build:
26+
name: ${{ matrix.name }} (${{ matrix.system }})
27+
needs: nix-matrix
28+
runs-on: ${{ matrix.os }}
1529
strategy:
16-
fail-fast: false
17-
matrix:
18-
system: [ x86_64-linux, aarch64-linux ]
19-
30+
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
2031
steps:
32+
- uses: actions/checkout@v4
33+
- uses: cachix/install-nix-action@v30
34+
with:
35+
extra_nix_config: |
36+
experimental-features = nix-command flakes impure-derivations
37+
- run: nix build -L '.#${{ matrix.attr }}'
2138

22-
- uses: actions/checkout@v4
23-
with:
24-
# Nix Flakes doesn't work on shallow clones
25-
fetch-depth: 0
2639

27-
- uses: cachix/install-nix-action@V27
28-
with:
29-
extra_nix_config: |
30-
experimental-features = nix-command flakes
31-
extra-platforms = ${{ matrix.system }}
40+
# build:
41+
# runs-on: ubuntu-latest
42+
# continue-on-error: true
43+
# strategy:
44+
# fail-fast: false
45+
# matrix:
46+
# system: [ x86_64-linux, aarch64-linux ]
3247

33-
- uses: cachix/cachix-action@v14
34-
with:
35-
name: nix-portable
36-
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
48+
# steps:
3749

38-
- name: Set up QEMU
39-
uses: docker/setup-qemu-action@v2
40-
with:
41-
image: tonistiigi/binfmt@sha256:8de6f2decb92e9001d094534bf8a92880c175bd5dfb4a9d8579f26f09821cfa2
42-
platforms: all
50+
# - uses: actions/checkout@v4
51+
# with:
52+
# # Nix Flakes doesn't work on shallow clones
53+
# fetch-depth: 0
4354

44-
- name: Install binfmt support
45-
run: sudo apt-get install -y
55+
# - uses: cachix/install-nix-action@V27
56+
# with:
57+
# extra_nix_config: |
58+
# experimental-features = nix-command flakes
59+
# extra-platforms = ${{ matrix.system }}
4660

47-
- run: 'nix build -L .#defaultPackage.${{ matrix.system }}'
61+
# - uses: cachix/cachix-action@v14
62+
# with:
63+
# name: nix-portable
64+
# authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
4865

49-
- name: Archive result
50-
uses: actions/upload-artifact@v4
51-
with:
52-
name: nix-portable-${{ matrix.system }}
53-
path: result/bin/nix-portable
66+
# - name: Set up QEMU
67+
# uses: docker/setup-qemu-action@v2
68+
# with:
69+
# image: tonistiigi/binfmt@sha256:8de6f2decb92e9001d094534bf8a92880c175bd5dfb4a9d8579f26f09821cfa2
70+
# platforms: all
5471

72+
# - name: Install binfmt support
73+
# run: sudo apt-get install -y
5574

75+
# - run: 'nix build -L .#defaultPackage.${{ matrix.system }}'
5676

77+
# - name: Archive result
78+
# uses: actions/upload-artifact@v4
79+
# with:
80+
# name: nix-portable-${{ matrix.system }}
81+
# path: result/bin/nix-portable
5782

58-
test_qemu:
59-
name: Test via qemu
60-
needs: build
61-
if: true
62-
runs-on: ubuntu-latest
63-
continue-on-error: true
64-
strategy:
65-
fail-fast: false
66-
matrix:
67-
qemu_os: [ arch, centos7, debian, nixos, ubuntu_22_04, ubuntu_23_10, ubuntu_24_04, debian-aarch64 ]
68-
steps:
83+
# test_qemu_x86_64:
84+
# name: Test via qemu x86_64-linux
85+
# needs: build
86+
# if: true
87+
# runs-on: ubuntu-latest
88+
# continue-on-error: true
89+
# strategy:
90+
# fail-fast: false
91+
# matrix:
92+
# qemu_os: [ arch, centos7, debian, nixos, ubuntu_22_04, ubuntu_23_10, ubuntu_24_04 ]
93+
# steps:
6994

70-
- uses: actions/checkout@v4
71-
with:
72-
# Nix Flakes doesn't work on shallow clones
73-
fetch-depth: 0
95+
# - uses: actions/checkout@v4
96+
# with:
97+
# # Nix Flakes doesn't work on shallow clones
98+
# fetch-depth: 0
7499

75-
- uses: cachix/install-nix-action@V27
76-
with:
77-
extra_nix_config: |
78-
experimental-features = nix-command flakes
79-
extra-platforms = ${{ matrix.system }}
100+
# - uses: cachix/install-nix-action@V27
101+
# with:
102+
# extra_nix_config: |
103+
# experimental-features = nix-command flakes
104+
# extra-platforms = ${{ matrix.system }}
80105

81-
- uses: cachix/cachix-action@v14
82-
with:
83-
name: nix-portable
84-
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
106+
# - uses: cachix/cachix-action@v14
107+
# with:
108+
# name: nix-portable
109+
# authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
85110

86-
- name: Set up QEMU
87-
uses: docker/setup-qemu-action@v2
88-
with:
89-
image: tonistiigi/binfmt@sha256:8de6f2decb92e9001d094534bf8a92880c175bd5dfb4a9d8579f26f09821cfa2
90-
platforms: all
111+
# - run: 'nix run -L .#job-qemu-${{ matrix.qemu_os }}'
91112

92-
- name: Install binfmt support
93-
run: sudo apt-get install -y
113+
# test_qemu_aarch64:
114+
# name: Test via qemu aarch64-linux
115+
# needs: build
116+
# if: true
117+
# runs-on: ubuntu-24.04-arm
118+
# continue-on-error: true
119+
# strategy:
120+
# fail-fast: false
121+
# matrix:
122+
# qemu_os: [ debian-aarch64 ]
123+
# steps:
124+
125+
# - uses: actions/checkout@v4
126+
# with:
127+
# # Nix Flakes doesn't work on shallow clones
128+
# fetch-depth: 0
129+
130+
# - uses: cachix/install-nix-action@V27
131+
# with:
132+
# extra_nix_config: |
133+
# experimental-features = nix-command flakes
134+
# extra-platforms = ${{ matrix.system }}
135+
136+
# - uses: cachix/cachix-action@v14
137+
# with:
138+
# name: nix-portable
139+
# authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
94140

95-
- run: 'nix run -L .#job-qemu-${{ matrix.qemu_os }}'
141+
# - run: 'nix run -L .#job-qemu-${{ matrix.qemu_os }}'
96142

97143
# test_nix-static:
98144
# name: Test nix-static via qemu
@@ -126,7 +172,7 @@ jobs:
126172

127173
test_github:
128174
name: Test inside github action
129-
needs: build
175+
needs: nix-build
130176
if: true
131177
runs-on: ubuntu-latest
132178
steps:

README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,13 @@ nix-portable is tested continuously on the following platforms:
137137

138138
- Distros (x86_64):
139139
- Arch Linux
140-
- CentOS 7
140+
- Fedora
141141
- Debian
142142
- NixOS
143-
- Ubuntu 22.04
144-
- Ubuntu 23.10
145-
- Ubuntu 24.04
143+
- Ubuntu
146144
- Distros (aarch64):
147145
- Debian
146+
- NixOS
148147
- Other Environments:
149148
- Github Actions
150149

flake.lock

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)