-
Notifications
You must be signed in to change notification settings - Fork 0
157 lines (132 loc) · 4.64 KB
/
ci.yaml
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
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [ published ]
jobs:
build-win:
strategy:
fail-fast: false
matrix:
include:
- qt_arch: win64_msvc2019_64
arch: x64
- qt_arch: win32_msvc2019
arch: Win32
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
with:
submodules: 'true'
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1 # not v2!
with:
path: ${{github.workspace}}/qt
key: ${{runner.os}}-Qt5-${{ matrix.arch }}
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: '5.15.2'
host: 'windows'
target: 'desktop'
arch: ${{ matrix.qt_arch }}
dir: '${{github.workspace}}/qt/'
modules: 'qtsvg'
cached: ${{steps.cache-qt.outputs.cache-hit}}
- name: Create Build Environment
run: cmake -E make_directory build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: cmake -DQT_WIN_PATH='${{env.Qt5_Dir}}' -DBUILD_TESTS=true -DWIN32_CONSOLE="Off" -G "Visual Studio 16 2019" -A ${{ matrix.arch }} ..
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --config Release
- name: Run tests
working-directory: ${{github.workspace}}/build/tests/Release
run: ./spacedisplay_test
- name: Copy necessary dlls
working-directory: ${{github.workspace}}/build/app-gui/Release
run: |
cp ${{env.Qt5_Dir}}/bin/Qt5Core.dll Qt5Core.dll
cp ${{env.Qt5_Dir}}/bin/Qt5Gui.dll Qt5Gui.dll
cp ${{env.Qt5_Dir}}/bin/Qt5Widgets.dll Qt5Widgets.dll
cp ${{env.Qt5_Dir}}/bin/Qt5Svg.dll Qt5Svg.dll
mkdir platforms
cp ${{env.Qt5_Dir}}/plugins/platforms/qwindows.dll platforms/qwindows.dll
# upload binaries
- name: Upload windows binary
uses: actions/upload-artifact@v2
with:
name: spacedisplay-msvc19-${{ matrix.arch }}
path: ${{github.workspace}}/build/app-gui/Release
build-linux:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: 'true'
- name: Install tools
run: ./ci/linux-install.sh
- name: Run coverage
run: ./ci/linux-coverage.sh
- name: Build
run: ./ci/linux-build.sh
- name: Run tests
working-directory: ${{github.workspace}}/build/tests
run: ./spacedisplay_test
- name: Upload AppImage
uses: actions/upload-artifact@v2
with:
name: SpaceDisplay-x86_64.AppImage
path: ${{github.workspace}}/bin/SpaceDisplay-x86_64.AppImage
- name: Upload coverage to codecov
uses: codecov/codecov-action@v2
with:
files: ${{ github.workspace }}/build_cov/coverage_xml.xml
- name: Upload coverage artifact
uses: actions/upload-artifact@v2
with:
name: coverage
path: ${{ github.workspace }}/build_cov/coverage_html
add-release-assets:
runs-on: ubuntu-latest
if: github.event_name == 'release'
needs: [ build-win, build-linux ]
steps:
- uses: actions/download-artifact@v2
with:
path: artifacts
- name: Display structure of downloaded files
working-directory: artifacts
run: ls -R
- name: Pack windows x64
working-directory: artifacts/spacedisplay-msvc19-x64
run: zip -r SpaceDisplay-msvc19-x64.zip *
- name: Pack windows x86
working-directory: artifacts/spacedisplay-msvc19-Win32
run: zip -r SpaceDisplay-msvc19-Win32.zip *
- uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: artifacts/spacedisplay-msvc19-Win32/SpaceDisplay-msvc19-Win32.zip
tag: ${{ github.ref }}
asset_name: SpaceDisplay-msvc19-Win32.zip
overwrite: true
- uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: artifacts/spacedisplay-msvc19-x64/SpaceDisplay-msvc19-x64.zip
tag: ${{ github.ref }}
asset_name: SpaceDisplay-msvc19-x64.zip
overwrite: true
- uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: artifacts/SpaceDisplay-x86_64.AppImage/SpaceDisplay-x86_64.AppImage
tag: ${{ github.ref }}
asset_name: SpaceDisplay-x86_64.AppImage
overwrite: true