-
Notifications
You must be signed in to change notification settings - Fork 117
129 lines (109 loc) · 3.81 KB
/
auth_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
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