This repository has been archived by the owner on Oct 2, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
102 lines (83 loc) · 3.48 KB
/
cmake.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
name: CMake
on:
push:
branches: [ qml ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-11, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Install Ubuntu dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt install --no-install-recommends build-essential devscripts debhelper cmake git libarchive-dev libcurl4-openssl-dev \
qtbase5-dev qtbase5-dev-tools qtdeclarative5-dev libqt5svg5-dev qttools5-dev qt5-default libssl-dev \
qml-module-qtquick2 qml-module-qtquick-controls2 qml-module-qtquick-layouts qml-module-qtquick-templates2 qml-module-qtquick-window2 qml-module-qtgraphicaleffects
- name: Install Windows dependencies
if: matrix.os == 'windows-latest'
run: |
choco install openssl
- name: Setup msys2
uses: msys2/setup-msys2@v2
if: matrix.os == 'windows-latest'
with:
msystem: MINGW64
install: >-
git
base-devel
mingw-w64-x86_64-gcc
mingw-w64-x86_64-cmake
update: true
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1 # not v2!
with:
path: ../Qt
key: ${{ runner.os }}-QtCache
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- name: Configure CMake
if: matrix.os != 'windows-latest'
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Configure CMake
if: matrix.os == 'windows-latest'
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -DCMAKE_TOOLCHAIN_FILE="cmake/Toolchains/mingw64-x86_64.cmake" -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
if: matrix.os != 'windows-latest'
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Build
if: matrix.os == 'windows-latest'
# Build your program with the given configuration
run: cmake -DCMAKE_TOOLCHAIN_FILE="cmake/Toolchains/mingw64-x86_64.cmake" --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
run: find build
- name: Upload Ubuntu build
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v2.2.4
with:
# Artifact name
name: citadel-imager-ubuntu
# A file, directory or wildcard pattern that describes what to upload
path: build/citadel-imager
- name: Upload macOS build
if: matrix.os == 'macOS-11'
uses: actions/upload-artifact@v2.2.4
with:
# Artifact name
name: citadel-imager-mac.dmg
# A file, directory or wildcard pattern that describes what to upload
path: build/citadel-imager.dmg