Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.10.0] Backport "Run tests as not-root" #1921

Merged
merged 1 commit into from Mar 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 16 additions & 6 deletions .github/workflows/test.yml
Expand Up @@ -32,8 +32,12 @@ jobs:
container: debian:${{ matrix.debian_version }}
steps:
- run: |
apt-get update && apt-get install --yes git make gnupg
apt-get update && apt-get install --yes git make gnupg sudo
- uses: actions/checkout@v4
- name: Setup user
run: |
# We want to run tests as a regular user, similar to Qubes VMs
useradd --create-home --shell /bin/bash user
- name: Install dependencies
run: |
source /etc/os-release
Expand All @@ -48,10 +52,11 @@ jobs:
echo "Unsupported Debian version: $VERSION_CODENAME"
exit 1
fi
poetry -C ${{ matrix.component }} install
sudo -u user poetry -C ${{ matrix.component }} install
- name: Run test
run: |
make -C ${{ matrix.component }} test
sudo chown -R user:user .
sudo -u user make -C ${{ matrix.component }} test

# Run the various `make test-...` commands for the client.
# TODO: these should be consolidated into one when feasible
Expand All @@ -70,8 +75,12 @@ jobs:
container: debian:${{ matrix.debian_version }}
steps:
- run: |
apt-get update && apt-get install --yes git make gnupg
apt-get update && apt-get install --yes git make gnupg sudo
- uses: actions/checkout@v4
- name: Setup user
run: |
# We want to run tests as a regular user, similar to Qubes VMs
useradd --create-home --shell /bin/bash user
- name: Install dependencies
run: |
source /etc/os-release
Expand All @@ -86,11 +95,12 @@ jobs:
echo "Unsupported Debian version: $VERSION_CODENAME"
exit 1
fi
poetry -C client install
make -C client ci-install-deps
sudo -u user poetry -C client install
- name: Run test
run: |
make -C client ${{ matrix.command }}
sudo chown -R user:user .
sudo -u user make -C client ${{ matrix.command }}

# Run the client i18n/l10n checks.
internationalization:
Expand Down