Skip to content

Commit c614119

Browse files
committed
Split CI from build actions, since they're for pretty different use-cases.
Reduce CI build combinations to an explicit 5.
1 parent 1d3ae5a commit c614119

File tree

3 files changed

+90
-17
lines changed

3 files changed

+90
-17
lines changed

.github/workflows/ci.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Build GDExtension
2+
on:
3+
workflow_call:
4+
push:
5+
pull_request:
6+
merge_group:
7+
8+
jobs:
9+
build:
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
# Test a few selected combinations of parameters
14+
# See https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax
15+
include:
16+
- target: { platform: linux, arch: x86_64, os: ubuntu-22.04 }
17+
target-type: template_debug
18+
float-precision: double
19+
- target: { platform: windows, arch: x86_64, os: windows-latest }
20+
target-type: template_release
21+
float-precision: single
22+
- target: { platform: macos, arch: universal, os: macos-latest }
23+
target-type: template_debug
24+
float-precision: single
25+
- target: { platform: android, arch: arm64, os: ubuntu-22.04 }
26+
target-type: template_debug
27+
float-precision: single
28+
- target: { platform: web, arch: wasm32, os: ubuntu-22.04 }
29+
target-type: template_release
30+
float-precision: double
31+
32+
runs-on: ${{ matrix.target.os }}
33+
steps:
34+
# Clone this repository
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
with:
38+
submodules: true
39+
40+
# Lint
41+
#- name: Setup clang-format
42+
# shell: bash
43+
# run: |
44+
# python -m pip install clang-format
45+
#- name: Run clang-format
46+
# shell: bash
47+
# run: |
48+
# clang-format src/** --dry-run --Werror
49+
50+
# Add linux x86_32 toolchain
51+
- name: Install multilib support
52+
if: ${{ matrix.target.platform == 'linux' && matrix.target.arch == 'x86_32' }}
53+
run: |
54+
sudo apt-get update && sudo apt-get install -y gcc-multilib g++-multilib
55+
56+
# Setup dependencies
57+
- name: Setup godot-cpp
58+
uses: ./godot-cpp/.github/actions/setup-godot-cpp
59+
with:
60+
platform: ${{ matrix.target.platform }}
61+
em-version: 3.1.62
62+
63+
# Build GDExtension (with caches)
64+
65+
- name: Restore .scons_cache
66+
uses: ./godot-cpp/.github/actions/godot-cache-restore
67+
with:
68+
scons-cache: ${{ github.workspace }}/.scons-cache/
69+
cache-name: ${{ matrix.target.platform }}_${{ matrix.target.arch }}_${{ matrix.float-precision }}_${{ matrix.target-type }}
70+
71+
- name: Build GDExtension Debug Build
72+
shell: sh
73+
env:
74+
SCONS_CACHE: ${{ github.workspace }}/.scons-cache/
75+
run: |
76+
scons target=${{ matrix.target-type }} platform=${{ matrix.target.platform }} arch=${{ matrix.target.arch }} precision=${{ matrix.float-precision }}
77+
78+
- name: Save .scons_cache
79+
uses: ./godot-cpp/.github/actions/godot-cache-save
80+
with:
81+
scons-cache: ${{ github.workspace }}/.scons-cache/
82+
cache-name: ${{ matrix.target.platform }}_${{ matrix.target.arch }}_${{ matrix.float-precision }}_${{ matrix.target-type }}

.github/workflows/builds.yml renamed to .github/workflows/make_build.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
name: Build GDExtension
1+
name: Make a GDExtension build for all supported platforms
22
on:
3-
workflow_call:
4-
push:
5-
pull_request:
6-
merge_group:
3+
workflow_dispatch:
74

85
jobs:
96
build:
@@ -41,16 +38,6 @@ jobs:
4138
with:
4239
submodules: true
4340

44-
# Lint
45-
#- name: Setup clang-format
46-
# shell: bash
47-
# run: |
48-
# python -m pip install clang-format
49-
#- name: Run clang-format
50-
# shell: bash
51-
# run: |
52-
# clang-format src/** --dry-run --Werror
53-
5441
# Add linux x86_32 toolchain
5542
- name: Install multilib support
5643
if: ${{ matrix.target.platform == 'linux' && matrix.target.arch == 'x86_32' }}

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,9 @@ scons compiledb=yes compile_commands.json
3636

3737
## Usage - Actions
3838

39-
This repository comes with a GitHub action that builds the GDExtension for cross-platform use. It triggers automatically for each pushed change. You can find and edit it in [builds.yml](.github/workflows/builds.yml).
40-
After a workflow run is complete, you can find the file `godot-cpp-template.zip` on the `Actions` tab on GitHub.
39+
This repository comes with a continuous integration (CI) through a GitHub action that builds the GDExtension for cross-platform use.
40+
It triggers automatically for each pushed change. You can find and edit it in [builds.yml](.github/workflows/ci.yml).
41+
42+
There is also a workflow that builds the GDExtension for all supported platforms that you can use to create releases.
43+
You can trigger this workflow manually from the `Actions` tab on GitHub.
44+
After it is complete, you can find the file `godot-cpp-template.zip` in the `Artifacts` section of the workflow run.

0 commit comments

Comments
 (0)