Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Improve godot-cpp actions #97166

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 24 additions & 29 deletions .github/workflows/godot_cpp_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +55 to +57
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't really affect anything but the godot-cpp build system doesn't have any cache limiting, so we'd have to see how this can be handled safely, but we do use the cache in godot-cpp so it shouldn't matter but just need to make sure it doesn't tax our CI too much by filling up our limits

Copy link
Member

@AThousandShips AThousandShips Sep 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that just from this PR the cache upload size was 825 mb for a single run, that's a lot for the 10 gig cache limit, and might cause important other cache entries to be dropped and hurt general compile times

I think that, until we've implemented a cache limiting system in godot-cpp we should avoid using the cache here, especially since the build time is just 8 minutes at least in this build, compared to if we evict a linux build which is 30+ minutes without cache

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, fair point; haven't considered any cache limiting techniques used here. For now, I'll keep those sections commented out and add a TODO note.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a look at adding cache pruning to godot-cpp over the next few days and we can see how it works out

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 changes: 4 additions & 0 deletions .github/workflows/static_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading