Skip to content

[Bot] Update i18n #7859

[Bot] Update i18n

[Bot] Update i18n #7859

Workflow file for this run

name: Linux Tests
on:
push:
branches:
- main
- "releases/**"
pull_request:
branches:
- main
- "releases/**"
# Restrict tests to the most recent commit.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_test_addons:
name: Build Test Addons
uses: ./.github/workflows/build_addons.yaml
with:
test-addons-name: test-addons-${{ github.sha }}
build_test_app:
name: Build Test Client
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.enumerate.outputs.tests }}
steps:
- name: Clone repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
submodules: "recursive"
persist-credentials: false
- run: |
sudo apt-get update
sudo apt-get install -y $(./scripts/linux/getdeps.py -a linux/debian/control) ccache
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: "3.10"
cache: "pip"
- run: pip install -r requirements.txt
- name: Setup compiler cache
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ~/.cache/ccache
key: ccache-linux-${{ runner.arch }}-${{ github.sha }}
restore-keys: ccache-linux-${{ runner.arch }}-${{ github.event.pull_request.base.sha }}
- name: Fetch cached rust crates
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: 3rdparty/cargo-vendor
key: cargo-vendor-${{ hashFiles('Cargo.lock') }}
enableCrossOsArchive: true
- name: Compile test client
shell: bash
run: |
mkdir -p build-${{ runner.os }}
cmake -S $(pwd) -B build-${{ runner.os }} -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DRUST_VENDOR_DIR=3rdparty/cargo-vendor
cmake --build build-${{ runner.os }} --target mozillavpn
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: test-client-${{ github.sha }}
path: |
build-${{ runner.os }}/*.txt
build-${{ runner.os }}/*.cmake
build-${{ runner.os }}/src/mozillavpn
build-${{ runner.os }}/tests/functional
- name: Save compiler cache
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
if: ${{ github.event_name != 'pull_request' }}
with:
path: ~/.cache/ccache
key: ccache-linux-${{ runner.arch }}-${{ github.sha }}
- name: Generate tasklist
id: enumerate
shell: bash
run: |
echo -n "tests=" >> $GITHUB_OUTPUT
for test in $(find tests/functional -name 'test*.js' | sort); do
printf '{"name": "%s", "path": "%s"}' "$(basename ${test%.js} | sed -n 's/test//p')" "$test"
done | jq -s -c >> $GITHUB_OUTPUT
functionaltests:
name: Functional tests
needs:
- build_test_app
- build_test_addons
runs-on: ubuntu-22.04
timeout-minutes: 45
strategy:
fail-fast: false # Don't cancel other jobs if a test fails
matrix:
test: ${{ fromJson(needs.build_test_app.outputs.matrix) }}
steps:
- name: Clone repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: test-client-${{ github.sha }}
path: build-${{ runner.os }}
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: test-addons-${{ github.sha }}
path: build-${{ runner.os }}/tests/functional/addons
- name: Install test dependecies
run: |
sudo apt-get update
sudo apt-get install -y $(./scripts/linux/getdeps.py -r linux/debian/control)
sudo apt install --no-upgrade firefox xvfb -y
chmod +x build-${{ runner.os }}/src/mozillavpn
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: "3.10"
cache: "pip"
- run: pip install -r requirements.txt
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 20
cache: "npm"
- run: npm install
- name: Running ${{ matrix.test.name }} Tests
id: runTests
shell: bash
env:
TZ: Europe/London
HEADLESS: yes
ARTIFACT_DIR: ${{ runner.temp }}/artifacts
TEST_NAME: ${{ matrix.test.name }}
run: ctest -R "test$TEST_NAME" --test-dir build-${{ runner.os }} --verbose
- name: Uploading artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: ${{ always() }}
with:
name: ${{ matrix.test.name }} Logs
path: ${{ runner.temp }}/artifacts