forked from asmaloney/GDExtensionTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (80 loc) · 2.6 KB
/
main.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
name: Main
on:
push:
paths-ignore:
- '.gitignore'
- '*.md'
jobs:
lint:
name: 🧹 Lint / 📜 C++
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run clang-format style check
uses: jidicula/[email protected]
with:
clang-format-version: '15'
exclude-regex: 'extern'
build:
strategy:
fail-fast: false
matrix:
build_type: ['Debug', 'Release']
config:
- { name: '🍏 macOS Clang', os: macos-latest }
- { name: '🐧 Linux GCC', os: ubuntu-latest }
- { name: '🪟 Windows MSVC', os: windows-latest }
name: 🛠 Build / ${{ matrix.config.name }} (${{ matrix.build_type }})
runs-on: ${{ matrix.config.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Dependencies (macOS)
if: matrix.config.os == 'macos-latest'
run: brew install ccache ninja
- name: Install Dependencies (Linux)
if: matrix.config.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y ccache ninja-build
- name: Install Dependencies (Windows)
if: matrix.config.os == 'windows-latest'
run: |
choco upgrade ccache ninja
- name: Setup MSVC (Windows)
if: matrix.config.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
- name: ccache
uses: hendrikmuhs/[email protected]
with:
max-size: '10G'
key: ${{ matrix.config.os }}-${{ matrix.build_type }}
- name: Configure
run: >
mkdir GDExtension-build
cmake
-B GDExtension-build
-G "Ninja"
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
--install-prefix ${{ github.workspace }}/install-${{ matrix.build_type }}
.
- name: Build
run: cmake --build GDExtension-build
- name: Install
run: cmake --install GDExtension-build
- name: Upload artifact (Debug)
if: matrix.build_type == 'Debug'
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}-Debug
path: |
${{ github.workspace }}/install-${{ matrix.build_type }}/*
- name: Upload artifact (Release)
if: matrix.build_type == 'Release'
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}-Release
path: |
${{ github.workspace }}/install-${{ matrix.build_type }}/*