Browse Source

Merge pull request #97742 from Repiteo/ci/godot-cpp-action

CI: Change `godot-cpp-test` from workflow to action
Thaddeus Crews 7 months ago
parent
commit
a6da0aa5c1

+ 39 - 0
.github/actions/godot-cpp-build/action.yml

@@ -0,0 +1,39 @@
+name: Build godot-cpp
+description: Build godot-cpp with the provided options.
+
+env:
+  GODOT_CPP_BRANCH: 4.3
+
+inputs:
+  bin:
+    description: Path to the Godot binary.
+    required: true
+    type: string
+  scons-flags:
+    description: Additional SCons flags.
+    type: string
+  scons-cache:
+    description: The SCons cache path.
+    default: ${{ github.workspace }}/.scons_cache/
+    type: string
+
+runs:
+  using: composite
+  steps:
+    - name: Checkout
+      uses: actions/checkout@v4
+      with:
+        submodules: recursive
+        repository: godotengine/godot-cpp
+        ref: ${{ env.GODOT_CPP_BRANCH }}
+        path: godot-cpp
+
+    - name: Extract API
+      shell: sh
+      run: ${{ inputs.bin }} --headless --dump-gdextension-interface --dump-extension-api
+
+    - name: SCons Build
+      shell: sh
+      env:
+        SCONS_CACHE: ${{ inputs.scons-cache }}
+      run: scons --directory=./godot-cpp/test "gdextension_dir=${{ github.workspace }}" ${{ inputs.scons-flags }}

+ 0 - 57
.github/workflows/godot_cpp_test.yml

@@ -1,57 +0,0 @@
-name: 🪲 Godot CPP
-on:
-  workflow_call:
-
-# Global Settings
-env:
-  # Used for the cache key. Add version suffix to force clean build.
-  GODOT_BASE_BRANCH: master
-  # Used for the godot-cpp checkout.
-  GODOT_CPP_BRANCH: 4.3
-
-jobs:
-  godot-cpp-tests:
-    runs-on: ubuntu-24.04
-    name: Build and test Godot CPP
-    timeout-minutes: 30
-    steps:
-      - name: Checkout
-        uses: actions/checkout@v4
-        with:
-          sparse-checkout: |
-            .github
-            misc/utility/problem-matchers.json
-
-      - name: Checkout godot-cpp
-        uses: actions/checkout@v4
-        with:
-          submodules: recursive
-          repository: godotengine/godot-cpp
-          ref: ${{ env.GODOT_CPP_BRANCH }}
-          path: godot-cpp
-
-      - name: Setup Python and SCons
-        uses: ./.github/actions/godot-deps
-
-      - name: Download GDExtension interface and API dump
-        uses: ./.github/actions/download-artifact
-        with:
-          name: godot-api-dump
-          path: ./godot-cpp/gdextension
-
-      # TODO: Enable caching when godot-cpp has proper cache limiting.
-
-      # - name: Restore Godot build cache
-      #   uses: ./.github/actions/godot-cache-restore
-      #   with:
-      #     cache-name: godot-cpp
-      #   continue-on-error: true
-
-      - name: Build godot-cpp test extension
-        run: scons --directory=./godot-cpp/test target=template_debug dev_build=yes verbose=yes
-
-      # - name: Save Godot build cache
-      #   uses: ./.github/actions/godot-cache-save
-      #   with:
-      #     cache-name: godot-cpp
-      #   continue-on-error: true

+ 10 - 9
.github/workflows/linux_builds.yml

@@ -33,7 +33,9 @@ jobs:
             proj-conv: true
             api-compat: true
             artifact: true
-            cache-limit: 1
+            # Validate godot-cpp compatibility on one arbitrary editor build.
+            godot-cpp: true
+            cache-limit: 2
 
           - name: Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)
             cache-name: linux-editor-double-sanitizers
@@ -44,8 +46,6 @@ jobs:
             build-mono: false
             tests: true
             proj-test: true
-            # Generate an API dump for godot-cpp tests.
-            api-dump: true
             # Skip 2GiB artifact speeding up action.
             artifact: false
             cache-limit: 7
@@ -158,6 +158,13 @@ jobs:
           tests: ${{ matrix.tests }}
           scons-cache-limit: ${{ matrix.cache-limit }}
 
+      - name: Compilation (godot-cpp)
+        uses: ./.github/actions/godot-cpp-build
+        if: matrix.godot-cpp
+        with:
+          bin: ${{ matrix.bin }}
+          scons-flags: target=template_debug dev_build=yes verbose=yes
+
       - name: Save Godot build cache
         uses: ./.github/actions/godot-cache-save
         with:
@@ -187,12 +194,6 @@ jobs:
         with:
           name: ${{ matrix.cache-name }}
 
-      - name: Dump Godot API
-        uses: ./.github/actions/godot-api-dump
-        if: matrix.api-dump
-        with:
-          bin: ${{ matrix.bin }}
-
       - name: Unit tests
         if: matrix.tests
         run: |

+ 0 - 12
.github/workflows/runner.yml

@@ -44,15 +44,3 @@ jobs:
     name: 🌐 Web
     needs: static-checks
     uses: ./.github/workflows/web_builds.yml
-
-  # Third stage: Run auxiliary tests using build artifacts from previous jobs.
-
-  # Can be turned off for PRs that intentionally break compat with godot-cpp,
-  # until both the upstream PR and the matching godot-cpp changes are merged.
-  godot-cpp-test:
-    name: 🪲 Godot CPP
-    # This can be changed to depend on another platform, if we decide to use it for
-    # godot-cpp instead. Make sure to move the .github/actions/godot-api-dump step
-    # appropriately.
-    needs: linux-build
-    uses: ./.github/workflows/godot_cpp_test.yml