-
Notifications
You must be signed in to change notification settings - Fork 0
161 lines (138 loc) · 5.22 KB
/
ci.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
name: CI
on: [push, pull_request]
jobs:
build-nix:
name: ${{ matrix.platform.name }}-${{ matrix.config.name }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- { name: Linux GCC, os: ubuntu-latest }
- { name: Linux Clang, os: ubuntu-latest, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ }
- { name: macOS, os: macos-latest }
config:
- { name: Dynamic, flags: -DBUILD_SHARED_LIBS=TRUE }
- { name: Static, flags: -DBUILD_SHARED_LIBS=FALSE }
steps:
- name: Install Dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install libxrandr-dev libxcursor-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev
- name: Checkout
uses: actions/checkout@v3
- name: Get commit hash and time
run: echo "HASH_TIME=$(git show -s --format="%h(%cd)" --date=format:"%Y-%m-%d %H.%M.%S %z")" >> "$GITHUB_ENV"
- name: Configure
shell: bash
run: cmake -S . -B build -DCMAKE_INSTALL_PREFIX=install ${{matrix.platform.flags}} ${{matrix.config.flags}}
- name: Build
shell: bash
run: cmake --build build --config Release
- name: Install
shell: bash
run: cmake --install build --config Release
- name : Upload full build artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform.name }}-${{ matrix.config.name }}@${{ env.HASH_TIME }}-full
path: |
build/
!build/_deps/
# - name: Upload binary only artifact
# uses: actions/upload-artifact@v3
# with:
# name: ${{ matrix.platform.name }}-${{ matrix.config.name }}-${{ env.HASH_TIME }}-binonly
# path: build/bin/
build-windows-msys2:
name: ${{ matrix.platform.name }}-${{ matrix.config.name }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- { name: Windows MSYS2 MinGW64, os: windows-2022, msys: true ,flags: -GNinja -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ }
config:
- { name: Dynamic, flags: -DBUILD_SHARED_LIBS=TRUE }
- { name: Static, flags: -DBUILD_SHARED_LIBS=FALSE }
steps:
- name: Install MSYS2
if: ${{ matrix.platform.msys }} == true
uses: msys2/setup-msys2@v2
with:
update: true
msystem: mingw64
install: mingw-w64-x86_64-gcc mingw-w64-x86_64-ninja mingw-w64-x86_64-cmake
- name: Checkout
uses: actions/checkout@v3
- name: Get commit hash and time
run: echo "HASH_TIME=$(git show -s --format="%h(%cd)" --date=format:"%Y-%m-%d %H.%M.%S %z")" >> $env:GITHUB_ENV
- name: Configure
shell: msys2 {0}
run: cmake -S . -B build -DCMAKE_INSTALL_PREFIX=install ${{matrix.platform.flags}} ${{matrix.config.flags}}
- name: Build
shell: msys2 {0}
run: cmake --build build --config Release
- name: Install
shell: msys2 {0}
run: |
cmake --install build --config Release
cp /mingw64/bin/libgcc_s_seh-*.dll build/bin/
cp /mingw64/bin/libwinpthread-*.dll build/bin/
cp /mingw64/bin/libstdc++-*.dll build/bin/
- name : Upload full build artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform.name }}-${{ matrix.config.name }}@${{ env.HASH_TIME }}-full
path: |
build/
!build/_deps/
# - name: Upload binary only artifact
# uses: actions/upload-artifact@v3
# with:
# name: ${{ matrix.platform.name }}-${{ matrix.config.name }}-${{ env.HASH_TIME }}-binonly
# path: build/bin/
# build-windows-msvc:
# name: ${{ matrix.platform.name }}-${{ matrix.config.name }}
# runs-on: ${{ matrix.platform.os }}
# needs: get-commit-hash-time
#
# strategy:
# fail-fast: false
# matrix:
# platform:
# - { name: Windows VS2019, os: windows-2019, msys: false }
# - { name: Windows VS2022, os: windows-2022, msys: false }
# config:
# - { name: Dynamic, flags: -DBUILD_SHARED_LIBS=TRUE }
# - { name: Static, flags: -DBUILD_SHARED_LIBS=FALSE }
#
# steps:
# - name: Checkout
# uses: actions/checkout@v3
#
# - name: Get commit hash and time
# shell: msys2 {0}
# run: echo "HASH_TIME=$(git show -s --format="%h(%cd)" --date=format:"%Y-%m-%d %H.%M.%S %z")" >> $env:GITHUB_ENV
#
# - name: Configure
# run: cmake -S . -B build -DCMAKE_INSTALL_PREFIX=install ${{matrix.platform.flags}} ${{matrix.config.flags}}
#
# - name: Build
# run: cmake --build build --config Release
#
# - name: Install
# run: cmake --install build --config Release
#
# - name : Upload full build artifact
# uses: actions/upload-artifact@v3
# with:
# name: ${{ matrix.platform.name }}-${{ matrix.config.name }}@${{ env.HASH_TIME }}-full
# path: |
# build/
# !build/_deps/
#
# # - name: Upload binary only artifact
# # uses: actions/upload-artifact@v3
# # with:
# # name: ${{ matrix.platform.name }}-${{ matrix.config.name }}-${{ env.HASH_TIME }}-binonly
# # path: build/bin/