-
Notifications
You must be signed in to change notification settings - Fork 25
190 lines (168 loc) · 5.55 KB
/
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
name: Tests
on:
push:
branches:
- "*"
pull_request:
branches:
- master
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
check:
runs-on: ubuntu-latest
outputs:
deploy: ${{ steps.git.outputs.deploy }}
steps:
- uses: actions/checkout@v3
- name: Install Python3
run: |
sudo apt install -y python3
- id: git
name: Check Commit Message
run: |
# Don't need tags to check if the commit message has
# the special commit.
echo "" /tmp/tags.txt
result=$(python3 scripts/check.py "$(git log -1 --pretty=%B)" "/tmp/tags.txt")
echo "deploy=$result" >> $GITHUB_OUTPUT
ubuntu:
needs: check
if: needs.check.outputs.deploy == 'false'
runs-on: ubuntu-${{ matrix.ubuntu_version }}
name: Ubuntu-${{ matrix.ubuntu_version }}-Qt-${{ matrix.qt_version }}-shared-${{ matrix.shared }}
strategy:
fail-fast: false
matrix:
ubuntu_version: [20.04, 22.04]
qt_version: [5.9.9, 5.15.2, 6.4.0]
shared: [ON, OFF]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt_version }}
cache: 'true'
cache-key-prefix: ${{ runner.os }}-Qt-Cache-${{ matrix.qt_version }}
dir: ${{ github.workspace }}/Qt
- name: Install LibArchive
run: |
mkdir build
cd build
git clone https://github.com/libarchive/libarchive
cd libarchive
git checkout "v3.5.1"
cmake -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" .
cmake --build . --config ${{env.BUILD_TYPE}}
sudo make install
cd ..
rm -rf libarchive
cd ..
sudo cp -fp /usr/local/lib/pkgconfig/libarchive.pc /usr/lib/pkgconfig/libarchive.pc
sudo cp -fp /usr/local/lib/libarchive.* /usr/lib/
- name: Configure CMake
run: cmake -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DBUILD_SHARED_LIBS=${{ matrix.shared }} -DBUILD_TESTS=ON -B "${{github.workspace}}/build"
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Run tests
working-directory: ${{github.workspace}}/build/tests
run: "ctest --verbose"
macos:
needs: check
if: needs.check.outputs.deploy == 'false'
runs-on: macos-${{ matrix.macos_version }}
name: macos-${{ matrix.macos_version }}-Qt6-${{ matrix.qt6 }}-${{ matrix.shared }}
strategy:
fail-fast: false
matrix:
macos_version: [12]
qt6: ['enabled', 'disabled']
shared: ['shared', 'static']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependencies
run: brew install meson ninja qt6 qt5
- name: Configure Meson
run: meson setup "${{github.workspace}}/build" -Ddefault_library=${{matrix.shared}} -Dqt6=${{matrix.qt6}} -Dpkg_config_path=/usr/local/opt/qt@5/lib/pkgconfig
- name: Build
run: meson compile -C "${{github.workspace}}/build" --verbose
- name: Run tests
run: meson test -C "${{github.workspace}}/build" --verbose
MSYS2:
needs: check
if: needs.check.outputs.deploy == 'false'
runs-on: windows-latest
name: MSYS2-${{matrix.platform}}
strategy:
matrix:
deps: ['enabled', 'disabled']
platform: ['MINGW64', 'UCRT64', 'CLANG64']
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.platform}}
pacboy: >-
cc:p
libarchive:p
meson:p
ninja:p
pkgconf:p
qt5-base:p
qt6-base:p
- name: Compile and Test
run: |
meson setup "${{github.workspace}}/build" -Dauto_features=${{matrix.deps}} -Dwarning_level=3 -Dcpp_std=c++20
meson compile -C "${{github.workspace}}/build" --verbose
meson test -C "${{github.workspace}}/build" --verbose
Ubuntu-meson:
needs: check
if: needs.check.outputs.deploy == 'false'
runs-on: ubuntu-20.04
name: Linux-GCC${{matrix.cxx}}
strategy:
matrix:
cxx: ['7', '13']
steps:
- uses: actions/checkout@v4
- uses: egor-tensin/setup-gcc@v1
with:
version: ${{matrix.cxx}}
- name: Install meson
run: |
python3 -m pip install meson ninja
sudo apt install -y libarchive-dev qtbase5-dev
- name: Compile and Test
run: |
meson setup "${{github.workspace}}/build" -Dwarning_level=3
meson compile -C "${{github.workspace}}/build" --verbose
meson test -C "${{github.workspace}}/build" --verbose
Ubuntu-meson-clang:
needs: check
if: needs.check.outputs.deploy == 'false'
runs-on: ubuntu-20.04
name: Linux-Clang${{matrix.cxx}}
strategy:
matrix:
cxx: ['7', '17']
steps:
- uses: actions/checkout@v4
- uses: egor-tensin/setup-clang@v1
with:
version: ${{matrix.cxx}}
- name: Install meson
run: |
python3 -m pip install meson ninja
sudo apt install -y libarchive-dev qtbase5-dev
- name: Compile and Test
run: |
meson setup "${{github.workspace}}/build" -Dwarning_level=3
meson compile -C "${{github.workspace}}/build" --verbose
meson test -C "${{github.workspace}}/build" --verbose