-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (76 loc) · 3.98 KB
/
ci.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
name: CI
on: [push, pull_request, workflow_dispatch]
jobs:
build:
name: Build
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-20.04, build_type: Debug, build_wxwidgets: OFF, use_sanitizers: ON }
- { os: ubuntu-20.04, build_type: Release, build_wxwidgets: OFF, use_sanitizers: ON }
- { os: windows-2019, build_type: Debug, build_wxwidgets: OFF, use_sanitizers: OFF }
- { os: windows-2019, build_type: Release, build_wxwidgets: OFF, use_sanitizers: OFF }
- { os: macos-11, build_type: Debug, build_wxwidgets: OFF, use_sanitizers: ON }
- { os: macos-11, build_type: Release, build_wxwidgets: OFF, use_sanitizers: ON }
# static minimal builds
- { os: ubuntu-20.04, build_type: Release, build_wxwidgets: ON, use_sanitizers: OFF }
- { os: windows-2019, build_type: Release, build_wxwidgets: ON, use_sanitizers: OFF }
- { os: macos-11, build_type: Release, build_wxwidgets: ON, use_sanitizers: OFF }
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install libgtk-3-dev
- if: runner.os == 'Linux' && matrix.build_wxwidgets == 'OFF'
run: |
sudo apt-key adv --fetch-keys 'https://repos.codelite.org/CodeLite.asc'
sudo apt-add-repository "deb https://repos.codelite.org/wx3.2.2.1/ubuntu/ $(lsb_release -cs) universe"
sudo apt install libwxgtk3.2unofficial-dev libnotify-dev
- if: runner.os == 'Windows' && matrix.build_wxwidgets == 'OFF'
run: |
wx_version="3.2.2.1" wx_version_short="3.2.2"
cd "${RUNNER_TEMP}"
wget="curl -fLO"
$wget "https://github.com/wxWidgets/wxWidgets/releases/download/v${wx_version}/wxWidgets-${wx_version}-headers.7z"
$wget "https://github.com/wxWidgets/wxWidgets/releases/download/v${wx_version}/wxMSW-${wx_version_short}_vc14x_x64_Dev.7z"
$wget "https://github.com/wxWidgets/wxWidgets/releases/download/v${wx_version}/wxMSW-${wx_version_short}_vc14x_x64_ReleasePDB.7z"
wx_dir="${RUNNER_TEMP}/wxWidgets-${wx_version}"
mkdir -p "${wx_dir}"
cd "${wx_dir}"
7z x -y "${RUNNER_TEMP}/wxWidgets-${wx_version}-headers.7z"
7z x -y "${RUNNER_TEMP}/wxMSW-${wx_version_short}_vc14x_x64_Dev.7z"
7z x -y "${RUNNER_TEMP}/wxMSW-${wx_version_short}_vc14x_x64_ReleasePDB.7z"
echo "WXWIN=${wx_dir}" >> "${GITHUB_ENV}"
- if: runner.os == 'macOS' && matrix.build_wxwidgets == 'OFF'
run: |
brew install wxwidgets
- uses: actions/cache@v3
if: matrix.build_wxwidgets == 'ON'
with:
path: build
key: |
${{github.workflow}}-${{runner.os}}-${{matrix.build_type}}-cmake-${{hashFiles('CMakeLists.txt', 'src/**/CMakeLists.txt', 'cmake/**/*')}}
restore-keys: |
${{github.workflow}}-${{runner.os}}-${{matrix.build_type}}-cmake-
- run: |
cmake -B build -DCMAKE_BUILD_TYPE='${{matrix.build_type}}' -DBUILD_WXWIDGETS_FROM_SOURCE='${{matrix.build_wxwidgets}}' \
-DUSE_SANITIZERS='${{matrix.use_sanitizers}}' -DGENERATE_DOCUMENTATION=OFF
- run: cmake --build build -j"$(nproc)" --config '${{matrix.build_type}}'
- run: cmake --build build -j"$(nproc)" --config '${{matrix.build_type}}' --target run-tests
- id: cpack
if: matrix.build_wxwidgets == 'ON'
run: |
(cd build && cpack -C '${{matrix.build_type}}')
package_file_name="$(sed -nE 's/set\(CPACK_PACKAGE_FILE_NAME "(.+)"\)/\1/p' build/CPackConfig.cmake)"
echo "package_file_name=${package_file_name}" >> "${GITHUB_OUTPUT}"
- uses: actions/upload-artifact@v3
if: matrix.build_wxwidgets == 'ON'
with:
name: ${{steps.cpack.outputs.package_file_name}}-ci-build
path: build/${{steps.cpack.outputs.package_file_name}}.*