-
-
Notifications
You must be signed in to change notification settings - Fork 5
171 lines (147 loc) · 6.13 KB
/
OnPush.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
171
name: OnPush
on:
push:
branches: [ "develop", "main" ]
jobs:
build-package:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
compiler: [MSVC, MinGW]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Restore vcpkg Cache
uses: actions/cache@v3
id: vcpkg-cache
with:
path: |
${{github.workspace}}/vcpkg/installed
key: |
vcpkg-${{runner.arch}}-${{matrix.compiler}}-${{runner.os}}-${{github.ref_name}}-${{hashFiles('scripts/**/portfile.cmake')}}-${{hashFiles('scripts/**/vcpkg.json')}}-${{github.sha}}
restore-keys: |
vcpkg-${{runner.arch}}-${{matrix.compiler}}-${{runner.os}}-${{github.ref_name}}-${{hashFiles('scripts/**/portfile.cmake')}}-${{hashFiles('scripts/**/vcpkg.json')}}-
vcpkg-${{runner.arch}}-${{matrix.compiler}}-${{runner.os}}-${{github.ref_name}}-${{hashFiles('scripts/**/portfile.cmake')}}-
vcpkg-${{runner.arch}}-${{matrix.compiler}}-${{runner.os}}-${{github.ref_name}}-
vcpkg-${{runner.arch}}-${{matrix.compiler}}-${{runner.os}}-
- name: Setup Ninja
uses: ashutoshvarma/setup-ninja@master
with:
version: 1.11.0
- name: Install MinGW
if: matrix.compiler == 'MinGW'
uses: egor-tensin/setup-mingw@v2
with:
platform: x64
static: 0
- name: Install vcpkg Windows
if: runner.os == 'Windows'
working-directory: ${{github.workspace}}/vcpkg
run: .\bootstrap-vcpkg.bat
- name: Install Packages MSVC
if: runner.os == 'Windows' && matrix.compiler == 'MSVC'
working-directory: ${{github.workspace}}/vcpkg
run: vcpkg install --x-manifest-root=../scripts/vcpkg-manifest --x-install-root=./installed --triplet=x64-windows
- name: Install Packages MinGW
if: runner.os == 'Windows' && matrix.compiler == 'MinGW'
working-directory: ${{github.workspace}}/vcpkg
run: vcpkg install --x-manifest-root=../scripts/vcpkg-manifest --x-install-root=./installed --triplet=x64-mingw-dynamic
- name: Archive vcpkg Logs
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: vcpkglogs-${{runner.os}}-${{runner.arch}}-${{matrix.compiler}}-${{github.sha}}
path: |
vcpkg/buildtrees/*/*.log
retention-days: 7
compression-level: 9
build:
needs: [build-package]
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
build_type: [Debug, Release]
compiler: [MSVC, MinGW]
include:
- compiler: MSVC
c_compiler: cl
cxx_compiler: cl
asm_compiler: cl
- compiler: MinGW
c_compiler: gcc
cxx_compiler: c++
asm_compiler: ''
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Restore vcpkg Cache
uses: actions/cache@v3
id: vcpkg-cache
with:
path: |
${{github.workspace}}/vcpkg/installed
key: |
vcpkg-${{runner.arch}}-${{matrix.compiler}}-${{runner.os}}-${{github.ref_name}}-${{hashFiles('scripts/**/portfile.cmake')}}-${{hashFiles('scripts/**/vcpkg.json')}}-${{github.sha}}
restore-keys: |
vcpkg-${{runner.arch}}-${{matrix.compiler}}-${{runner.os}}-${{github.ref_name}}-${{hashFiles('scripts/**/portfile.cmake')}}-${{hashFiles('scripts/**/vcpkg.json')}}-
vcpkg-${{runner.arch}}-${{matrix.compiler}}-${{runner.os}}-${{github.ref_name}}-${{hashFiles('scripts/**/portfile.cmake')}}-
vcpkg-${{runner.arch}}-${{matrix.compiler}}-${{runner.os}}-${{github.ref_name}}-
vcpkg-${{runner.arch}}-${{matrix.compiler}}-${{runner.os}}-
- name: Setup Ninja
uses: ashutoshvarma/setup-ninja@master
with:
version: 1.11.0
- name: Install MinGW
if: matrix.compiler == 'MinGW'
uses: egor-tensin/setup-mingw@v2
with:
platform: x64
static: 0
- name: Install vcpkg Windows
if: runner.os == 'Windows'
working-directory: ${{github.workspace}}/vcpkg
run: .\bootstrap-vcpkg.bat
- name: Initialize MSVC Environment
if: matrix.compiler == 'MSVC'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{runner.arch}}
- name: Configure CMake MSVC
if: runner.os == 'Windows' && matrix.compiler == 'MSVC'
working-directory: ${{github.workspace}}
env:
CC: ${{matrix.c_compiler}}
CXX: ${{matrix.cxx_compiler}}
ASM: ${{matrix.asm_compiler}}
run: cmake -G "Ninja" -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_TOOLCHAIN_FILE:STRING=./vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET:STRING=x64-windows -B out/build/${{runner.arch}}-${{matrix.build_type}}-${{matrix.compiler}} .
- name: Configure CMake MinGW
if: runner.os == 'Windows' && matrix.compiler == 'MinGW'
working-directory: ${{github.workspace}}
env:
CC: ${{matrix.c_compiler}}
CXX: ${{matrix.cxx_compiler}}
ASM: ${{matrix.asm_compiler}}
run: cmake -G "Ninja" -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_TOOLCHAIN_FILE:STRING=./vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET:STRING=x64-mingw-dynamic -B out/build/${{runner.arch}}-${{matrix.build_type}}-${{matrix.compiler}} .
- name: Build
working-directory: ${{github.workspace}}
run: ninja -C out/build/${{runner.arch}}-${{matrix.build_type}}-${{matrix.compiler}} -j 2 VocalShaper
- name: Pre Packing Windows
if: runner.os == 'Windows'
working-directory: ${{github.workspace}}
run: .\prePacking.bat .\out\build\${{runner.arch}}-${{matrix.build_type}}-${{matrix.compiler}}\bin
- name: Archive Artifacts
uses: actions/upload-artifact@v4
with:
name: VocalShaper-${{runner.os}}-${{runner.arch}}-${{matrix.compiler}}-${{matrix.build_type}}-${{github.sha}}
path: |
out/build/${{runner.arch}}-${{matrix.build_type}}-${{matrix.compiler}}/bin/**
retention-days: 7
compression-level: 9