Skip to content

Commit

Permalink
Fix the CI...
Browse files Browse the repository at this point in the history
  • Loading branch information
nlewo committed Dec 16, 2022
1 parent 3b0c0ee commit da9259f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/podman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ jobs:
steps:
- uses: actions/[email protected]
- uses: cachix/install-nix-action@v15
- run: nix run -L '.#tests.all'
- run: |
# See https://github.com/containers/podman/issues/5114#issuecomment-779406347
rm -rf ~/.local/share/containers/
nix run -L '.#tests.all'
3 changes: 3 additions & 0 deletions examples/nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ nix2container.buildImage {
# A user is required by nix
# https://github.com/NixOS/nix/blob/9348f9291e5d9e4ba3c4347ea1b235640f54fd79/src/libutil/util.cc#L478
"USER=nobody"
# When running in podman on the GitHub CI, Nix fails to find the
# user home dir for an unkonwn reason...
"HOME=/"
];
};
# This is to check store path in nested layers are also added to the
Expand Down
8 changes: 7 additions & 1 deletion tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ let
ret=$?
if [ $ret -ne 0 ];
then
echo "image list"
${pkgs.podman}/bin/podman image list
echo ""
echo "Actual output:"
${pkgs.podman}/bin/podman run ${image.imageName}:${image.imageTag} ${command}
echo
Expand Down Expand Up @@ -133,7 +136,10 @@ let
};
};
all =
let scripts = pkgs.lib.concatMapStringsSep "\n" (s: "${s}/bin/test-script") (builtins.attrValues tests);
let scripts =
pkgs.lib.concatStringsSep
"\n"
(pkgs.lib.mapAttrsToList (n: v: "echo Running test '${n}'\n${v}/bin/test-script") tests);
in pkgs.writeScriptBin "all-test-scripts" ''
set -e
${scripts}
Expand Down

0 comments on commit da9259f

Please sign in to comment.