Skip to content

Commit 35fcfc1

Browse files
committed
GitHub Actions: run tests in nix-shell, not Docker
For some reason, the MAC address reported by dnsmasq in Docker on GitHub Actions no longer matches the address expected by the test. With Nix, it works.
1 parent 2e5277d commit 35fcfc1

File tree

4 files changed

+16
-47
lines changed

4 files changed

+16
-47
lines changed

.github/workflows/go.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@ jobs:
4141
with:
4242
go-version: 'stable'
4343

44-
- name: Build Docker container with the tools our tests require
45-
run: |
46-
docker build --pull --no-cache --rm -t=router7 -f travis/Dockerfile .
44+
- uses: cachix/install-nix-action@v31
45+
with:
46+
nix_path: nixpkgs=channel:nixos-25.05
4747

48-
- name: Run tests in Docker container
49-
run: |
50-
exit=0; for pkg in $(go list ./integration/...); do go test -c $pkg && docker run --privileged --net=host -v $PWD:/usr/src:ro router7 /bin/sh -c "./$(basename $pkg).test -test.v" || exit=1; done; [ $exit = 0 ]
48+
- name: Run tests in nix-shell
49+
run: nix-shell --command 'make test'

shell.nix

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
pkgs ? import <nixpkgs> { },
3+
}:
4+
pkgs.mkShell {
5+
packages = with pkgs; [
6+
dnsmasq
7+
dig
8+
ndisc6
9+
nftables
10+
];
11+
}

travis/Dockerfile

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

travis/loopmkfs.sh

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

0 commit comments

Comments
 (0)