Browse Source

CI: Improve `godot-cpp` actions

Thaddeus Crews 10 months ago
parent
commit
593744b733
2 changed files with 28 additions and 29 deletions
  1. 24 29
      .github/workflows/godot_cpp_test.yml
  2. 4 0
      .github/workflows/static_checks.yml

+ 24 - 29
.github/workflows/godot_cpp_test.yml

@@ -21,49 +21,44 @@ jobs:
       - name: Checkout
         uses: actions/checkout@v4
         with:
-          submodules: recursive
-
-      - name: Setup Python and SCons
-        uses: ./.github/actions/godot-deps
+          sparse-checkout: .github
 
-      # Checkout godot-cpp
       - name: Checkout godot-cpp
         uses: actions/checkout@v4
         with:
+          submodules: recursive
           repository: godotengine/godot-cpp
           ref: ${{ env.GODOT_CPP_BRANCH }}
-          submodules: recursive
           path: godot-cpp
 
-      # Download generated API dump
+      - name: Setup Python and SCons
+        uses: ./.github/actions/godot-deps
+
+      - name: Setup GCC problem matcher
+        uses: ammaraskar/gcc-problem-matcher@master
+
       - name: Download GDExtension interface and API dump
         uses: ./.github/actions/download-artifact
         with:
           name: godot-api-dump
-          path: ./godot-api
+          path: ./godot-cpp/gdextension
 
-      # Extract and override existing files with generated files
-      - name: Extract GDExtension interface and API dump
-        run: |
-          cp -f godot-api/gdextension_interface.h godot-cpp/gdextension/
-          cp -f godot-api/extension_api.json godot-cpp/gdextension/
+      # TODO: Enable caching when godot-cpp has proper cache limiting.
 
-      # TODO: Add caching to the SCons build and store it for CI via the godot-cache
-      # action.
+      # - name: Restore Godot build cache
+      #   uses: ./.github/actions/godot-cache-restore
+      #   with:
+      #     cache-name: godot-cpp
+      #   continue-on-error: true
 
-      # Build godot-cpp test extension
       - name: Build godot-cpp test extension
-        run: |
-          cd godot-cpp/test
-          scons target=template_debug dev_build=yes
-          cd ../..
-
-  gdextension-c-compile:
-    runs-on: 'ubuntu-20.04'
-    name: 'Check GDExtension header with a C compiler'
-    steps:
-      - uses: actions/checkout@v4
+        env: # Keep synced with godot-build.
+          SCONS_CACHE: ${{ github.workspace }}/.scons-cache/
+          SCONS_CACHE_LIMIT: 7168
+        run: scons --directory=./godot-cpp/test target=template_debug dev_build=yes verbose=yes
 
-      - name: 'Run C compiler on gdextension_interface.h'
-        run: |
-          gcc -c core/extension/gdextension_interface.h
+      # - name: Save Godot build cache
+      #   uses: ./.github/actions/godot-cache-save
+      #   with:
+      #     cache-name: godot-cpp
+      #   continue-on-error: true

+ 4 - 0
.github/workflows/static_checks.yml

@@ -57,3 +57,7 @@ jobs:
       - name: Class reference schema checks
         run: |
           xmllint --noout --schema doc/class.xsd doc/classes/*.xml modules/*/doc_classes/*.xml platform/*/doc_classes/*.xml
+
+      - name: Run C compiler on `gdextension_interface.h`
+        run: |
+          gcc -c core/extension/gdextension_interface.h