More Mordor Fixes #15826
Workflow file for this run
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: Unit 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: | |
linux-unit-tests: | |
runs-on: ubuntu-22.04 | |
name: Run Unit tests on Linux | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- name: Install dependences | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y $(./scripts/linux/getdeps.py -a linux/debian/control) | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.9" | |
cache: "pip" | |
- run: pip install -r requirements.txt | |
- name: Building tests | |
shell: bash | |
run: | | |
mkdir -p build | |
cmake -S . -B $(pwd)/build -GNinja | |
cmake --build $(pwd)/build --target build_tests | |
- name: Running native messaging tests | |
shell: bash | |
run: ctest -L nativemessaging --test-dir $(pwd)/build --output-on-failure | |
- name: Running QML tests | |
shell: bash | |
run: ctest -L qml --test-dir $(pwd)/build --output-on-failure | |
- name: Running unit tests | |
shell: bash | |
run: ctest -L unit --test-dir $(pwd)/build --output-on-failure | |
macos-unit-tests: | |
runs-on: macos-latest | |
defaults: | |
run: | |
shell: bash -el {0} | |
name: Run Unit tests on MacOS | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniconda-version: "latest" | |
environment-file: env.yml | |
activate-environment: vpn | |
- name: Install dependencies | |
run: | | |
./scripts/macos/conda_install_extras.sh | |
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path) | |
brew install ninja | |
- name: Install Qt6 | |
run: | | |
wget https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/mozillavpn.v2.mozillavpn.cache.level-3.toolchains.v3.qt-macos-6.6.latest/artifacts/public%2Fbuild%2Fqt6_mac.zip -O mac.zip | |
unzip -a mac.zip | |
sudo mv qt_dist /opt | |
cd .. | |
- name: Building tests | |
run: | | |
export PATH=/opt/qt_dist/bin:$PATH | |
mkdir -p build | |
cmake -S . -B $(pwd)/build -GNinja | |
cmake --build $(pwd)/build --target build_tests | |
- name: Running native messaging tests | |
run: ctest -L nativemessaging --test-dir $(pwd)/build --output-on-failure | |
- name: Running QML tests | |
run: ctest -L qml --test-dir $(pwd)/build --output-on-failure | |
- name: Running unit tests | |
run: ctest -L unit --test-dir $(pwd)/build --output-on-failure | |
windows-unit-tests: | |
name: Run Unit tests on Windows | |
runs-on: windows-latest | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- name: Install Qt | |
shell: pwsh | |
run: | | |
Invoke-WebRequest -Uri https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/mozillavpn.v2.mozillavpn.cache.level-3.toolchains.v3.qt-windows-x86_64-6.6.latest/artifacts/public%2Fbuild%2Fqt6_win.zip -OutFile win.zip | |
Expand-Archive win.zip | |
mv win\QT_OUT "C:\\MozillaVPNBuild" | |
- name: Add msvc dev commands to PATH | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.9" | |
cache: "pip" | |
- run: pip install -r requirements.txt | |
- name: Cache Wireguard NT | |
id: cache-wireguard-nt | |
uses: actions/cache@v4 | |
with: | |
path: 3rdparty/wireguard-nt | |
key: wireguard-nt-${{ hashFiles('windows/wireguard_nt/CMakeLists.txt') }} | |
- name: Download Wireguard NT | |
if: steps.cache-wireguard-nt.outputs.cache-hit != 'true' | |
shell: bash | |
run: | | |
WIREGUARD_NT_URL=$(grep -Eo 'DOWNLOAD[[:space:]].*' windows/wireguard_nt/CMakeLists.txt | awk '{print $2}') | |
curl -sSL -o wireguard-nt.zip $WIREGUARD_NT_URL | |
unzip -d 3rdparty/ wireguard-nt.zip | |
- name: Building tests | |
run: | | |
mkdir ./build | |
cmake -S . -B ./build -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="C:\MozillaVPNBuild\lib\cmake" -DWIREGUARD_FOLDER="3rdparty/wireguard-nt" | |
cmake --build ./build --target build_tests | |
- name: Running native messaging tests | |
shell: bash | |
run: ctest -L nativemessaging --test-dir ./build --output-on-failure | |
- name: Running QML tests | |
shell: bash | |
run: ctest -L qml --test-dir ./build --output-on-failure | |
- name: Running unit tests | |
shell: bash | |
run: ctest -L unit --test-dir ./build --output-on-failure | |
rust-unit-tests: | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
name: Run Unit tests for Rust (${{ matrix.os }}) | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Fetch glean submodules | |
run: | | |
git submodule update --init 3rdparty/glean | |
- name: Signature library tests | |
shell: bash | |
working-directory: ./signature | |
run: cargo test -- --nocapture |