Skip to content

Commit

Permalink
Run tests under a regular user when running in a container.
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed Feb 4, 2025
1 parent db730d1 commit 5f36d7a
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/shunit2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,24 @@ jobs:
- name: Install dependencies
run: dnf update -q -y && dnf install -q -y make patch wget curl shunit2
- name: Run tests
run: make test
run: |
useradd user
chown -R user:user .
sudo -u user make test
opensuse:
runs-on: ubuntu-latest
container: opensuse/tumbleweed:latest
name: "Run tests on OpenSUSE"
steps:
- name: Install dependencies
run: zypper ref && zypper --non-interactive in tar gzip findutils make patch wget shunit2
run: zypper ref && zypper --non-interactive in sudo tar gzip findutils make patch wget shunit2
- uses: actions/checkout@v4
- name: Run tests
run: make test
run: |
useradd user
chown -R user:user .
sudo -u user make test
archlinux:
runs-on: ubuntu-latest
Expand All @@ -52,7 +58,10 @@ jobs:
sudo -u makepkg /bin/bash -c "cd /home/makepkg && git clone --quiet --depth 1 https://aur.archlinux.org/shunit2.git && cd shunit2/ && makepkg" && \
pacman -U --noconfirm /home/makepkg/shunit2/shunit2-*.pkg.tar.zst
- name: Run tests
run: make test
run: |
useradd user
chown -R user:user .
sudo -u user make test
macos:
runs-on: macos-latest
Expand All @@ -77,4 +86,7 @@ jobs:
copyback: false
prepare: |
pkg install -y wget curl shunit2
run: make test
run: |
pw useradd user
chown -R user:user .
su -m user -c "make test"

0 comments on commit 5f36d7a

Please sign in to comment.