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 3, 2025
1 parent abca35d commit b4da9fc
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 @@ -26,20 +26,26 @@ jobs:
- name: Configure env
run: echo "SHUNIT2=$(command -v shunit2 2>/dev/null)" >> $GITHUB_ENV
- 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: Configure env
run: echo "SHUNIT2=$(command -v shunit2 2>/dev/null)" >> $GITHUB_ENV
- 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 @@ -60,7 +66,11 @@ jobs:
- name: Configure env
run: echo "SHUNIT2=$(command -v shunit2 2>/dev/null)" >> $GITHUB_ENV
- name: Run tests
run: make test
run: |
command -v shunit2
useradd user
chown -R user:user .
sudo -u user /bin/bash -c "make test"
macos:
runs-on: macos-latest
Expand Down Expand Up @@ -89,4 +99,6 @@ jobs:
pkg install -y wget curl shunit2
run: |
export SHUNIT2="$(command -v shunit2 2>/dev/null)"
make test
pw useradd user
chown -R user:user .
su -m user -c "make test"

0 comments on commit b4da9fc

Please sign in to comment.