From ec146676ffa2dac4a146033763c783d02f99755e Mon Sep 17 00:00:00 2001 From: Aleksandr Mezin Date: Tue, 5 Nov 2024 04:44:22 +0200 Subject: [PATCH] Test podman --- .github/workflows/common.yml | 6 +++++- test.sh | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 test.sh diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml index 954ed24..58fe828 100644 --- a/.github/workflows/common.yml +++ b/.github/workflows/common.yml @@ -31,7 +31,8 @@ jobs: uses: docker/metadata-action@v5 with: images: ghcr.io/${{ github.repository }} - - uses: docker/build-push-action@v6 + - id: docker_build + uses: docker/build-push-action@v6 with: context: . pull: true @@ -43,3 +44,6 @@ jobs: ghcr.io/${{ github.repository }}:master ${{ steps.docker_meta.outputs.tags }} cache-to: type=inline + - run: >- + docker run --rm -v ./test.sh:/test.sh:ro --privileged --cgroupns=host + ${{ steps.docker_build.outputs.imageid }} /test.sh diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..b2ea75a --- /dev/null +++ b/test.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -ex + +mount --make-rshared / +CGROUP="$(grep '^0::' /proc/self/cgroup)" +chown -R github-actions:github-actions "/sys/fs/cgroup${CGROUP#0::}" + +sudo --preserve-env --set-home --user=github-actions -- podman run --rm alpine:latest true