Attempt to get whistleflow export working following mega merge #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: [push, pull_request] | |
# Only build for latest push/PR unless it's main or release/ | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !startsWith( github.ref, 'refs/heads/release/' ) }} | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
# Run `make test` against all components but client, which is special | |
component: | |
strategy: | |
fail-fast: false | |
matrix: | |
component: | |
- export | |
- log | |
- proxy | |
debian_version: | |
- bullseye | |
- bookworm | |
# bookworm jobs are failing and will be | |
# replaced with proxy v2 shortly, so skip | |
# https://github.com/freedomofpress/securedrop-client/issues/1681 | |
exclude: | |
- component: proxy | |
debian_version: bookworm | |
runs-on: ubuntu-latest | |
container: debian:${{ matrix.debian_version }} | |
steps: | |
- run: | | |
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 | |
if [[ "$VERSION_CODENAME" == "bullseye" ]]; then | |
# Install Poetry via PyPI | |
apt-get install --yes --no-install-recommends python3-pip | |
pip install poetry==1.6.1 | |
elif [[ "$VERSION_CODENAME" == "bookworm" ]]; then | |
# Install Poetry via system package | |
apt-get install --yes --no-install-recommends python3-poetry | |
else | |
echo "Unsupported Debian version: $VERSION_CODENAME" | |
exit 1 | |
fi | |
sudo -u user poetry -C ${{ matrix.component }} install | |
- name: Run test | |
run: | | |
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 | |
client: | |
strategy: | |
fail-fast: false | |
matrix: | |
command: | |
- test-functional | |
- test-integration | |
- test-random | |
debian_version: | |
- bullseye | |
- bookworm | |
runs-on: ubuntu-latest | |
container: debian:${{ matrix.debian_version }} | |
steps: | |
- run: | | |
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 | |
if [[ "$VERSION_CODENAME" == "bullseye" ]]; then | |
# Install Poetry via PyPI | |
apt-get install --yes --no-install-recommends python3-pip | |
pip install poetry==1.6.1 | |
elif [[ "$VERSION_CODENAME" == "bookworm" ]]; then | |
# Install Poetry via system package | |
apt-get install --yes --no-install-recommends python3-poetry | |
else | |
echo "Unsupported Debian version: $VERSION_CODENAME" | |
exit 1 | |
fi | |
make -C client ci-install-deps | |
sudo -u user poetry -C client install | |
- name: Run test | |
run: | | |
sudo chown -R user:user . | |
sudo -u user make -C client ${{ matrix.command }} | |
# Run the client i18n/l10n checks. | |
internationalization: | |
strategy: | |
matrix: | |
debian_version: | |
- bullseye | |
- bookworm | |
runs-on: ubuntu-latest | |
container: debian:${{ matrix.debian_version }} | |
steps: | |
- run: | | |
apt-get update && apt-get install --yes git make | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
source /etc/os-release | |
if [[ "$VERSION_CODENAME" == "bullseye" ]]; then | |
# Install Poetry via PyPI | |
apt-get install --yes --no-install-recommends python3-pip | |
pip install poetry==1.6.1 | |
elif [[ "$VERSION_CODENAME" == "bookworm" ]]; then | |
# Install Poetry via system package | |
apt-get install --yes --no-install-recommends python3-poetry | |
else | |
echo "Unsupported Debian version: $VERSION_CODENAME" | |
exit 1 | |
fi | |
poetry -C client install | |
make -C client ci-install-deps | |
git config --global --add safe.directory '*' | |
- name: Check that source strings are updated | |
run: make -C client check-strings | |
- name: Check that translation machine objects are reproducible | |
run: make -C client verify-mo |