Skip to content

Commit 048fe9f

Browse files
committed
Run tests under a regular user when running in a container.
1 parent 7f0d298 commit 048fe9f

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

.github/workflows/shunit2.yml

+17-5
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,24 @@ jobs:
2222
- name: Install dependencies
2323
run: dnf update -q -y && dnf install -q -y make patch wget curl shunit2
2424
- name: Run tests
25-
run: make test
25+
run: |
26+
useradd user
27+
chown -R user:user .
28+
sudo -u user make test
2629
2730
opensuse:
2831
runs-on: ubuntu-latest
2932
container: opensuse/tumbleweed:latest
3033
name: "Run tests on OpenSUSE"
3134
steps:
3235
- name: Install dependencies
33-
run: zypper ref && zypper --non-interactive in tar gzip findutils make patch wget shunit2
36+
run: zypper ref && zypper --non-interactive in sudo tar gzip findutils make patch wget shunit2
3437
- uses: actions/checkout@v4
3538
- name: Run tests
36-
run: make test
39+
run: |
40+
useradd user
41+
chown -R user:user .
42+
sudo -u user make test
3743
3844
archlinux:
3945
runs-on: ubuntu-latest
@@ -52,7 +58,10 @@ jobs:
5258
sudo -u makepkg /bin/bash -c "cd /home/makepkg && git clone --quiet --depth 1 https://aur.archlinux.org/shunit2.git && cd shunit2/ && makepkg" && \
5359
pacman -U --noconfirm /home/makepkg/shunit2/shunit2-*.pkg.tar.zst
5460
- name: Run tests
55-
run: make test
61+
run: |
62+
useradd user
63+
chown -R user:user .
64+
sudo -u user make test
5665
5766
macos:
5867
runs-on: macos-latest
@@ -77,4 +86,7 @@ jobs:
7786
copyback: false
7887
prepare: |
7988
pkg install -y wget curl shunit2
80-
run: make test
89+
run: |
90+
pw useradd user
91+
chown -R user:user .
92+
su -m user -c "make test"

0 commit comments

Comments
 (0)