Skip to content

Commit 31dc4f3

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 31dc4f3

10 files changed

+795
-356
lines changed

.github/workflows/nix-portable.yml

+110-67
Original file line numberDiff line numberDiff line change
@@ -5,94 +5,137 @@ 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+
- run: nix build -L '.#${{ matrix.attr }}'
2135

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

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

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

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

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

47-
- run: 'nix build -L .#defaultPackage.${{ matrix.system }}'
58+
# - uses: cachix/cachix-action@v14
59+
# with:
60+
# name: nix-portable
61+
# authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
4862

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

69+
# - name: Install binfmt support
70+
# run: sudo apt-get install -y
5571

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

74+
# - name: Archive result
75+
# uses: actions/upload-artifact@v4
76+
# with:
77+
# name: nix-portable-${{ matrix.system }}
78+
# path: result/bin/nix-portable
5779

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:
80+
# test_qemu_x86_64:
81+
# name: Test via qemu x86_64-linux
82+
# needs: build
83+
# if: true
84+
# runs-on: ubuntu-latest
85+
# continue-on-error: true
86+
# strategy:
87+
# fail-fast: false
88+
# matrix:
89+
# qemu_os: [ arch, centos7, debian, nixos, ubuntu_22_04, ubuntu_23_10, ubuntu_24_04 ]
90+
# steps:
6991

70-
- uses: actions/checkout@v4
71-
with:
72-
# Nix Flakes doesn't work on shallow clones
73-
fetch-depth: 0
92+
# - uses: actions/checkout@v4
93+
# with:
94+
# # Nix Flakes doesn't work on shallow clones
95+
# fetch-depth: 0
7496

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

81-
- uses: cachix/cachix-action@v14
82-
with:
83-
name: nix-portable
84-
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
103+
# - uses: cachix/cachix-action@v14
104+
# with:
105+
# name: nix-portable
106+
# authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
85107

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

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

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

97140
# test_nix-static:
98141
# name: Test nix-static via qemu
@@ -126,7 +169,7 @@ jobs:
126169

127170
test_github:
128171
name: Test inside github action
129-
needs: build
172+
needs: nix-build
130173
if: true
131174
runs-on: ubuntu-latest
132175
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)