-
-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (143 loc) · 4.78 KB
/
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
name: Build and test
on: [push, pull_request]
defaults:
run:
shell: bash
env:
SCONS_CACHE: ${{ github.workspace }}/.scons-cache
jobs:
build_macos:
name: ${{ matrix.platform }} (simulator=${{ matrix.simulator }}, ${{ matrix.arch }}, ${{ matrix.target }})
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
target: [template_debug, template_release]
arch: [universal]
platform: [macos, ios]
simulator: [true, false]
exclude:
- platform: macos
simulator: true
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install dependencies
run: |
brew install scons
- name: Cache SCons files and compiled files
uses: actions/cache@v3
with:
path: .scons-cache/
key: ${{ matrix.platform }}-simulator=${{ matrix.simulator }}-${{ matrix.arch }}-${{ matrix.target }}
- name: Build artifact
run: |
scons platform=${{ matrix.platform }} ios_simulator=${{ matrix.simulator }} arch=${{ matrix.arch }} target=${{ matrix.target }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.target }}
path: |
addons/objc-gdextension/build/libobjcgdextension.*
build_linux:
name: ${{ matrix.platform }} (${{ matrix.arch }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch: [x86_64, x86_32]
platform: [linux, windows, android]
include:
- platform: linux
arch: x86_32
packages: [g++-multilib]
- platform: windows
packages: [g++-mingw-w64]
- platform: android
arch: arm64
- platform: android
arch: arm32
scons-args: android_api_level=19
- platform: android
arch: x86_32
scons-args: android_api_level=19
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install scons ${{ join(matrix.packages, ' ') }}
- name: Build artifact
run: |
scons platform=${{ matrix.platform }} arch=${{ matrix.arch }} target=template_release build_library=false ${{ join(matrix.scons-args, ' ') }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform }}-${{ matrix.arch }}
path: |
addons/objc-gdextension/build/libobjcgdextension.*
test_distribution:
name: Test ${{ matrix.name }}
needs: [build_macos]
runs-on: ${{ matrix.runner-os }}
strategy:
fail-fast: false
matrix:
include:
- name: macOS
runner-os: macos-latest
godot-release: 4.1.1-stable/Godot_v4.1.1-stable_macos.universal.zip
godot-bin: ./Godot.app/Contents/MacOS/Godot
env:
GODOT_BIN: ${{ matrix.godot-bin }}
steps:
- uses: actions/checkout@v3
- name: Download artifacts
id: download
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Copy artifacts to build folder
run: cp -r '${{ steps.download.outputs.download-path }}'/**/libobjcgdextension* addons/objc-gdextension/build
env:
MSYS_NO_PATHCONV: 1
- name: Download Godot
run: |
curl --location https://github.com/godotengine/godot/releases/download/${{ matrix.godot-release }} --output godot.zip
unzip godot.zip
# Must run Godot editor at least once to generate .godot folder
- name: Generate .godot folder
run: |
$GODOT_BIN --headless --quit --path test --editor
continue-on-error: true
# Now run the tests
- name: Run tests
run: |
$GODOT_BIN --headless --quit --path test --script test_entrypoint.gd
build_distribution_zip:
name: Build distribution zip
needs: [build_macos, build_linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Download artifacts
id: download
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Copy artifacts to build folder
run: cp -r ${{ steps.download.outputs.download-path }}/**/libobjcgdextension* addons/objc-gdextension/build
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: objc-gdextension
path: |
LICENSE
addons/objc-gdextension/LICENSE
addons/objc-gdextension/*.gdextension
addons/objc-gdextension/build/libobjcgdextension*