-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (84 loc) · 2.81 KB
/
Copy pathcmake-multi-platform.yml
File metadata and controls
95 lines (84 loc) · 2.81 KB
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: Cross Platform Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm ]
platform: [ linux, windows ]
c_compiler: [ gcc, clang, cl ]
build_type: [ Debug, Release ]
include:
- c_compiler: gcc
cpp_compiler: g++
- c_compiler: clang
cpp_compiler: clang++
- c_compiler: cl
cpp_compiler: cl
- os: ubuntu-latest
architecture: x86-64
- os: ubuntu-24.04-arm
architecture: arm64
- os: windows-latest
architecture: x86-64
- os: windows-11-arm
architecture: arm64
exclude:
- platform: linux
os: windows-latest
- platform: linux
os: windows-11-arm
- platform: windows
os: ubuntu-latest
- platform: windows
os: ubuntu-24.04-arm
- platform: linux
c_compiler: cl
- platform: windows
c_compiler: gcc
- platform: windows
c_compiler: clang
steps:
- uses: actions/checkout@v5
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Cache Dependencies
uses: actions/cache@v4
with:
path: ${{ steps.strings.outputs.build-output-dir }}/_deps
key: ${{ matrix.build_type }}-${{ matrix.c_compiler }}-deps-${{ hashFiles('**/.git/HEAD') }}
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DLUNA_WARNINGS_ARE_FATAL=ON
-DLUNA_EXAMPLES=OFF
-S ${{ github.workspace }}
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
- name: Upload Compiled Binary
if: ${{ matrix.os == 'linux' }}
uses: actions/upload-artifact@v5
with:
name: libLuna_${{ matrix.architecture }}_${{ matrix.build_type }}_${{ matrix.c_compiler }}.a
path: build/libLuna.a
retention-days: 90
- name: Upload Compiled Binary
if: ${{ matrix.os == 'windows' }}
uses: actions/upload-artifact@v5
with:
name: Luna_${{ matrix.architecture }}_${{ matrix.build_type }}.lib
path: build/${{ matrix.build_type }}/Luna.lib
retention-days: 90