-
-
Notifications
You must be signed in to change notification settings - Fork 0
158 lines (158 loc) · 5.06 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
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
---
jobs:
build:
permissions:
contents: write
runs-on: ${{ matrix.os }}
steps:
- id: fixed_workspace
name: Fix path
run: >-
echo out=$("${{github.workspace}}" -Replace "\\","/") | Out-File
-FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: latest_tag
name: Get Latest Tag
uses: WyriHaximus/github-action-get-previous-tag@v1
- name: Configure
run: >-
cmake -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -B ${{github.workspace}}/build
--install-prefix ${{github.workspace}}/build/prefix
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=${{matrix.lto}}
- name: Build
run: cmake --build ${{github.workspace}}/build --verbose --config ${{matrix.build-type}}
- name: Install
run: cmake --install ${{github.workspace}}/build --config ${{matrix.build-type}} --verbose
- name: Configure Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
- name: Crash test
run: ${{github.workspace}}/build/prefix/bin/winprefs.exe -c -d
- name: Show Git log of export
run: |
cd "${env:APPDATA}/prefs-export"
git --no-pager log
- name: Package
run: >-
cpack -C ${{matrix.build-type}} --config ${{github.workspace}}/build/CPackConfig.cmake
--verbose
- if: matrix.os == 'windows-2022' && matrix.build-type == 'Release'
name: Upload package
uses: softprops/action-gh-release@v1
with:
files: |
${{steps.fixed_workspace.outputs.out}}/winprefs-*.exe
${{steps.fixed_workspace.outputs.out}}/winprefs-*.zip
tag_name: ${{ steps.latest_tag.outputs.tag }}
strategy:
fail-fast: false
matrix:
build-type: [Debug, Release]
lto: ['FALSE', 'TRUE']
os:
- windows-2019
- windows-2022
build_cross:
runs-on: ubuntu-latest
steps:
- name: Set up MinGW
uses: egor-tensin/setup-mingw@v2
with:
platform: x64
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure
run: >-
cmake -B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=${{matrix.build-type}}
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc
-DCMAKE_SYSTEM_NAME=Windows -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=${{matrix.lto}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build-type}} --verbose
strategy:
fail-fast: false
matrix:
build-type: [Debug, Release]
lto: ['FALSE', 'TRUE']
build_msys:
runs-on: windows-latest
steps:
- id: fixed_workspace
name: Fix path
run: >-
echo out=$("${{github.workspace}}" -Replace "\\","/") | Out-File
-FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
- uses: msys2/setup-msys2@v2
with:
install: >-
make
msystem: ${{matrix.sys.name}}
pacboy: >-
cmake:p
ninja:p
toolchain:p
update: true
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure
run: >-
cmake -G Ninja -B ${{steps.fixed_workspace.outputs.out}}/build
--install-prefix ${{steps.fixed_workspace.outputs.out}}/build/prefix
-DCMAKE_BUILD_TYPE=${{matrix.build-type}}
shell: msys2 {0}
- name: Build
run: cmake --build ${{steps.fixed_workspace.outputs.out}}/build --verbose
shell: msys2 {0}
- name: Install
run: >-
cmake --install ${{steps.fixed_workspace.outputs.out}}/build
--config ${{matrix.build-type}} --verbose
shell: msys2 {0}
- name: Package
run: >-
cpack -C ${{matrix.build-type}}
--config ${{steps.fixed_workspace.outputs.out}}/build/CPackConfig.cmake --verbose
shell: msys2 {0}
- name: Configure Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
- name: Crash test
run: ${{github.workspace}}/build/prefix/bin/winprefs.exe -c -d
- name: Show Git log of export
run: |
cd "${env:APPDATA}/prefs-export"
git --no-pager log
strategy:
fail-fast: false
matrix:
build-type: [Debug, Release]
exclude:
# Crashes in Release but not reproducible on Win11
- build-type: Release
sys:
name: clang32
sys:
- env: clang-i686
name: clang32
- env: clang-x86_64
name: clang64
- env: i686
name: mingw32
- env: x86_64
name: mingw64
- env: ucrt-x86_64
name: ucrt64
name: Build
'on':
pull_request:
branches:
- master
push:
branches:
- master