-
Notifications
You must be signed in to change notification settings - Fork 34
171 lines (141 loc) · 4.79 KB
/
cmake-tier1.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
name: Build (Tier 1 platforms)
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: RelWithDebInfo
SMARTMONTOOLS_INSTALLER: smartmontools-7.2-1.win32-setup.exe
SMARTMONTOOLS_URL: https://nav.dl.sourceforge.net/project/smartmontools/smartmontools/7.2/smartmontools-7.2-1.win32-setup.exe
jobs:
linux-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Update Package Database
run: sudo apt-get update
- name: Install Dependencies
run: sudo apt-get install libpcre3-dev libgtkmm-3.0-dev gettext
- name: Create Build Directory
run: cmake -E make_directory build
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
env:
CC: gcc-13
CXX: g++-13
run: >
cmake $GITHUB_WORKSPACE
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DAPP_BUILD_EXAMPLES=ON
-DAPP_BUILD_TESTS=ON
-DAPP_COMPILER_ENABLE_WARNINGS=ON
- name: Build
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake --build . --config $BUILD_TYPE
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest -C $BUILD_TYPE
- name: Pack (cmake install and make binary package)
shell: bash
working-directory: ${{github.workspace}}/build
run: cpack -G TBZ2
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: Linux Packages
path: ${{github.workspace}}/build/gsmartcontrol-*-Linux*.*
windows-msys2:
runs-on: windows-latest
strategy:
matrix:
include: [
{ msystem: MINGW64, arch: x86_64 },
{ msystem: MINGW32, arch: i686 }
]
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
# p7zip is needed to extract smartmontools
# fontconfig owns /etc/fonts
with:
msystem: ${{ matrix.msystem }}
update: true
install: >-
mingw-w64-${{ matrix.arch }}-gtkmm3
mingw-w64-${{ matrix.arch }}-pkg-config
mingw-w64-${{ matrix.arch }}-cmake
mingw-w64-${{ matrix.arch }}-gcc
mingw-w64-${{ matrix.arch }}-fontconfig
mingw-w64-${{ matrix.arch }}-pcre
make
p7zip
- name: Configure CMake
shell: msys2 {0}
run: >
cmake -B build -S "$GITHUB_WORKSPACE" -G "MSYS Makefiles"
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DAPP_BUILD_EXAMPLES=ON
-DAPP_BUILD_TESTS=ON
-DAPP_COMPILER_ENABLE_WARNINGS=ON
- name: Build
shell: msys2 {0}
working-directory: ${{github.workspace}}/build
run: cmake --build . --config $BUILD_TYPE
- name: Test
working-directory: ${{github.workspace}}/build
shell: msys2 {0}
run: ctest -C $BUILD_TYPE
- name: Download Package Requirements
shell: msys2 {0}
working-directory: ${{github.workspace}}/build
run: |
mkdir smartmontools
cd smartmontools
wget $SMARTMONTOOLS_URL
- name: Extract Package Requirements (64-bit)
if: ${{ matrix.msystem == 'MINGW64' }}
shell: msys2 {0}
working-directory: ${{github.workspace}}/build/smartmontools
run: >
7z -bb1 e $SMARTMONTOOLS_INSTALLER
bin64/smartctl.exe
bin64/smartctl-nc.exe
bin/update-smart-drivedb.exe
bin/drivedb.h
- name: Extract Package Requirements (32-bit)
if: ${{ matrix.msystem == 'MINGW32' }}
shell: msys2 {0}
working-directory: ${{github.workspace}}/build/smartmontools
run: >
7z -bb1 e $SMARTMONTOOLS_INSTALLER
bin/smartctl.exe
bin/smartctl-nc.exe
bin/update-smart-drivedb.exe
bin/drivedb.h
- name: Package ZIP
shell: msys2 {0}
working-directory: ${{github.workspace}}/build
run: cpack -G ZIP
- name: Package NSIS (64-bit)
if: ${{ matrix.msystem == 'MINGW64' }}
shell: msys2 {0}
working-directory: ${{github.workspace}}/build
run: cpack -G NSIS64
- name: Package NSIS (32-bit)
if: ${{ matrix.msystem == 'MINGW32' }}
shell: msys2 {0}
working-directory: ${{github.workspace}}/build
run: cpack -G NSIS
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: Windows Packages
path: ${{github.workspace}}/build/gsmartcontrol-*-win*.*