Update README.md (#9218) #303
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: Auth Tests | |
on: | |
# Only run on push to main or release branches. | |
push: | |
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 auth tests on Linux | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: "recursive" | |
- name: Install dependences | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y $(./scripts/linux/getdeps.py -a linux/debian/control) | |
pip3 install -r requirements.txt | |
- name: Building tests | |
shell: bash | |
run: | | |
mkdir -p build | |
cmake -S . -B $(pwd)/build \ | |
-DCMAKE_CXX_FLAGS=--coverage -DCMAKE_EXE_LINKER_FLAGS=--coverage | |
cmake --build $(pwd)/build --target app_auth_tests -j$(nproc) | |
- name: Running tests | |
shell: bash | |
working-directory: ./build/tests/auth_tests | |
run: | | |
export PATH=${{github.workspace}}/grcov-build/bin:$PATH | |
ctest --output-on-failure | |
macos-unit-tests: | |
runs-on: macos-latest | |
name: Run auth tests on MacOS | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: "recursive" | |
- name: Install dependencies | |
shell: bash | |
run: | | |
pip3 install -r requirements.txt | |
brew install ninja | |
- name: Install Qt6 | |
shell: bash | |
run: | | |
wget https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/mozillavpn.v2.mozillavpn.cache.level-3.toolchains.v3.qt-mac.latest/artifacts/public%2Fbuild%2Fqt6_mac.zip -O mac.zip | |
unzip -a mac.zip | |
sudo mv qt_dist /opt | |
cd .. | |
- name: Install Grcov | |
if: steps.cache-grcov.outputs.cache-hit != 'true' | |
shell: bash | |
run: | | |
cargo install grcov --root ${{github.workspace}}/grcov-build --version 0.8.13 | |
- name: Building tests | |
shell: bash | |
run: | | |
export PATH=/opt/qt_dist/bin:${{github.workspace}}/grcov-build/bin:$PATH | |
mkdir -p build | |
cmake -S . -B $(pwd)/build -GNinja \ | |
-DCMAKE_CXX_FLAGS=--coverage -DCMAKE_EXE_LINKER_FLAGS=--coverage | |
cmake --build $(pwd)/build --target app_auth_tests | |
- name: Running tests | |
shell: bash | |
working-directory: ./build/tests/auth_tests | |
run: | | |
export PATH=/opt/qt_dist/bin:${{github.workspace}}/grcov-build/bin:$PATH | |
ctest --output-on-failure | |
windows-unit-tests: | |
name: Run auth tests on Windows | |
runs-on: windows-latest | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
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-win.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/[email protected] | |
- name: Install depedencies | |
shell: bash | |
run: | | |
pip3 install -r requirements.txt | |
- name: Building tests | |
run: | | |
mkdir ./build | |
cmake -S . -B ./build -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="C:\MozillaVPNBuild\lib\cmake" | |
cmake --build ./build --target app_auth_tests | |
- name: Running tests | |
shell: bash | |
working-directory: ./build/tests/auth_tests | |
run: | | |
ctest --output-on-failure |