-
Notifications
You must be signed in to change notification settings - Fork 41
96 lines (80 loc) · 2.83 KB
/
peanut-sdl.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
name: build
on:
push:
branches:
- master
pull_request:
branches-ignore:
- '**pages**'
env:
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm-cache
jobs:
build:
name: ${{ matrix.os }}-${{ matrix.build_type }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-11]
build_type: [RelWithDebInfo]
generator: [Ninja]
nice-arch: [x86_64]
include:
- os: ubuntu-22.04
nice-name: "Linux-glibc2.35"
- os: macos-11
nice-name: "macOS11"
- os: windows-2022
build_type: RelWithDebInfo
generator: "Visual Studio 17 2022"
arch: x64
additional-cmake-args: -T v143 -A x64
nice-arch: "x86_64"
nice-name: "Windows7"
- os: windows-2019
build_type: RelWithDebInfo
generator: "Visual Studio 16 2019"
arch: x86
additional-cmake-args: -T v141_xp -A Win32
nice-arch: "i386"
nice-name: "WindowsXP"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Initialise MSVC environment
if: "contains(matrix.os, 'windows')"
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- uses: lukka/get-cmake@latest
- run: mkdir ${{ env.CPM_SOURCE_CACHE }}
- name: Cache multiple paths
uses: actions/cache@v3
with:
path: |
${{ env.CPM_SOURCE_CACHE }}
${{ github.workspace }}/build/_deps
${{ github.workspace }}/build/**/cmake_pch.*
key: ${{ matrix.os }}-${{ hashFiles('examples/sdl2/CMakeLists.txt','.github/workflows/peanut-sdl.yml') }}
- name: Build
run: |
cmake -S ./examples/sdl2/ -B ${{github.workspace}}/build -G "${{matrix.generator}}" -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DLIBRARY_DISCOVER_METHOD=CPM ${{matrix.additional-cmake-args}}
cmake --build build --config ${{matrix.BUILD_TYPE}}
- name: Tar output on Unix systems
if: "contains(matrix.os, 'windows') == false"
run: |
cd ${{github.workspace}}/build
tar cf peanut-sdl.tar peanut-sdl*
- name: Get Short SHA
id: vars
shell: bash
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Upload output
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.nice-name }}-${{ matrix.nice-arch }}-${{ matrix.build_type }}-${{ steps.vars.outputs.sha_short }}
path: |
${{ github.workspace }}/build/peanut-sdl.tar
${{ github.workspace }}/build/**/peanut-sdl.exe
${{ github.workspace }}/build/**/peanut-sdl.pdb