Skip to content

Commit 0e60ddb

Browse files
committed
tests: Add NixOS test
Thanks to Jan Tojnar for the basic recipe! This inexplicably breaks test-static-code very early: It is run through umockdev-wrapper (like any other test), and that fails to link the preload library. Disable test-static-code for the time being; failures will appear in the other operating systems.
1 parent bef867a commit 0e60ddb

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
- dnf-centos:8
1818
- alpine-latest
1919
- alpine-latest@gudev
20+
- nix
2021
include:
2122
- scenario: alpine-latest@gudev
2223
env: EXTRA_PACKAGES=libgudev-dev

tests/run-nix

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh
2+
set -eu
3+
4+
# keep container around if $DEBUG is set
5+
[ -n "${DEBUG:-}" ] || OPTS="--rm"
6+
7+
if type podman >/dev/null 2>&1; then
8+
RUNC=podman
9+
else
10+
RUNC="sudo docker"
11+
fi
12+
13+
$RUNC run --interactive ${OPTS:-} --volume `pwd`:/source:ro docker.io/nixos/nix /bin/sh <<EOF
14+
# HACK: test-static-code fails: https://github.com/martinpitt/umockdev/issues/115#issuecomment-751456532
15+
cp -a /source /tmp/source
16+
sed -i '/test-static-code/d' /tmp/source/meson.build
17+
18+
nix-build --keep-failed -E '(import (builtins.fetchTarball { url = "https://github.com/NixOS/nixpkgs/archive/master.tar.gz"; }) {}).umockdev.overrideAttrs (attrs: { src = /tmp/source; patches = []; preCheck = ""; doCheck = true; })'
19+
EOF

0 commit comments

Comments
 (0)