-
Notifications
You must be signed in to change notification settings - Fork 62
157 lines (136 loc) · 5.7 KB
/
cmake_build.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
name: CMake Build
on:
push:
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
env:
SNEEDACITY_CMAKE_GENERATOR: ${{ matrix.config.generator }}
SNEEDACITY_ARCH_LABEL: ${{ matrix.config.arch }}
# Windows codesigning
# This variables will be used by all the steps
WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }}
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
strategy:
fail-fast: false
matrix:
config:
- name: Ubuntu_18.04
os: ubuntu-18.04
arch: x86_64 # as reported by `arch` or `uname -m`
generator: Ninja
compiler_cache: ccache
compiler_cache_path: ~/.ccache
# Mac OS disabled because there is not maintainer for Mac.
# - name: macOS_Intel
# os: macos-latest
# arch: Intel # as reported by Apple menu > About This Mac
# generator: Ninja
# compiler_cache: ccache
# compiler_cache_path: ~/Library/Caches/ccache
- name: Windows_32bit
#same as below
#os: windows-latest
os: windows-2019
arch: x86 # as reported by Windows Settings > System > About
#sets the parameter to the -G option that will be given to cmake in the configure.sh script
# generator: Ninja
cc: cl
cxx: cl
compiler_cache: sccache
compiler_cache_path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache
- name: Windows_64bit
#This wsas:
#os: windows-latest
#but at some point pressumably due to a Windows/MSVC update the Windows builds broke with this message:
#C:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um\winnt.h(253): fatal error C1189: #error: Must define a target architecture.
#According to https://stackoverflow.com/questions/65402366/c5105-and-other-compiler-warnings-when-building-with-github-actions-winsdk-10
#this error happens because there are many Windows SDK versions installed that conflict with each other. This idea is supported by the fact that there were
#two different version numbers mentioned in the compilation logs, 10.0.10011.16384 and 10.0.22000.0, unless they're versions of different things.
#He solved by giving the -DCMAKE_SYSTEM_VERSION option to CMake but I couldn't solve it that way.
#So we switch to the Windows Server 2019 version of the Actions VM image.
#This is fixed by disabling Ninja.
os: windows-2019
arch: amd64 # as reported by Windows Settings > System > About
# generator: Ninja
cc: cl
cxx: cl
compiler_cache: sccache
compiler_cache_path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache
steps:
- name: Checkout
uses: actions/checkout@v2
# Installs ninja, which is then called from /usr/local/share/cmake-3.22/Modules/CMakeNinjaFindMake.cmake
# Disabled because it breaks the Windows builds.
# - uses: seanmiddleditch/gha-setup-ninja@v3
- name: Dependencies
run: |
exec bash "scripts/ci/dependencies.sh"
- name: Environment
run: |
source "scripts/ci/environment.sh"
- name: "Set up MSVC Developer Command Prompt"
if: startswith( matrix.config.os, 'windows' )
uses: seanmiddleditch/gha-setup-vsdevenv@master
with:
arch: ${{ matrix.config.arch }}
- name: "Install sccache"
if: startswith( matrix.config.os, 'windows' )
env:
LINK: https://github.com/mozilla/sccache/releases/download/v0.2.15/sccache-v0.2.15-x86_64-pc-windows-msvc.tar.gz
run: |
mkdir C:/sccache
cd C:/sccache
curl.exe -LO "$LINK"
tar.exe -xf *
echo "C:/sccache" >> $GITHUB_PATH
- name: "Set up compiler cache"
uses: actions/cache@v2
with:
path: ${{ matrix.config.compiler_cache_path }}
key: ${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ github.head_ref }}-${{ github.run_number }}
restore-keys: |
${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ github.head_ref }}-
#- name: Install Apple codesigning certificates
# uses: apple-actions/import-codesign-certs@v1
# if: startswith( matrix.config.os, 'macos' ) && github.event_name == 'push' && github.repository_owner == 'audacity'
# with:
# p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }}
# p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
- name: Configure
env:
# Error reporing
SENTRY_DSN_KEY: ${{ secrets.SENTRY_DSN_KEY }}
SENTRY_HOST: ${{ secrets.SENTRY_HOST }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
# Apple code signing
APPLE_CODESIGN_IDENTITY: ${{ secrets.APPLE_CODESIGN_IDENTITY }}
APPLE_NOTARIZATION_USER_NAME: ${{ secrets.APPLE_NOTARIZATION_USER_NAME }}
APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
run: |
exec bash "scripts/ci/configure.sh"
- name: Build
run: |
exec bash "scripts/ci/build.sh"
- name: Install
run: |
exec bash "scripts/ci/install.sh"
- name: Package
run: |
exec bash "scripts/ci/package.sh"
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: Sneedacity_${{ matrix.config.name }}_${{ github.run_id }}_${{ env.GIT_HASH_SHORT }}
path: |
build/package/*
!build/package/_CPack_Packages
if-no-files-found: error