Skip to content

Commit d9b9881

Browse files
committed
Add and use a non-root user
1 parent d83d938 commit d9b9881

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/test-installers.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ jobs:
8585
runs-on: ubuntu-latest
8686
arch: x64
8787
hadron-platform: linux
88+
test-command-prefix: sudo --user compass
8889
container:
8990
image: rockylinux:9
9091
volumes:
@@ -142,9 +143,14 @@ jobs:
142143
with:
143144
node-version: 20
144145
cache: "npm"
145-
- name: Install dependencies (on Rocky linux)
146+
- name: Configure Rocky linux
146147
if: matrix.container.image == 'rockylinux:9'
147-
run: dnf install -y sudo gcc gcc-c++ make git nss dbus xorg-x11-server-Xvfb
148+
run: |
149+
# Install dependencies
150+
dnf install -y sudo gcc gcc-c++ make git nss dbus xorg-x11-server-Xvfb
151+
# Add a non-admin sudoer user
152+
adduser compass
153+
echo "compass ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
148154
149155
- name: Cache downloads
150156
uses: actions/cache@v4
@@ -189,4 +195,4 @@ jobs:
189195
# Exposing token to prevent update server from being rate limited
190196
GITHUB_TOKEN: ${{ github.token }}
191197
working-directory: packages/compass-smoke-tests
192-
run: npm start -- --package ${{ matrix.package }} --tests ${{ matrix.test }}
198+
run: ${{ matrix.test-command-prefix }} npm start -- --package ${{ matrix.package }} --tests ${{ matrix.test }}

0 commit comments

Comments
 (0)