Skip to content

Commit 1e5690d

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 1e5690d

File tree

3 files changed

+91
-14
lines changed

3 files changed

+91
-14
lines changed

.github/workflows/ci.yml

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

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-
5444
# Add linux x86_32 toolchain
5545
- name: Install multilib support
5646
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)