Commit graph

47 commits

Author SHA1 Message Date
A Thousand Ships
a2d16c0313
[CI] Run unit tests on desktop release templates 2024-07-18 15:17:33 +02:00
A Thousand Ships
32f8292679
[CI] Upload build cache before running tests
This improves turnaround time on large PRs where compilation is
successful but unit testing or similar fails, forcing recompilation of
unchanged code
2024-07-13 17:45:37 +02:00
bruvzg
db93bbbc10
[CI] Enable ANGLE static linking. 2024-05-28 17:28:17 +03:00
Rémi Verschelde
a63c37dca1
SCons: Bump min version to 3.1.2, test it on CI with one Linux job
The min SCons version had to be bumped as SCons 3.0 before 3.0.3 seems
broken (see #92043), and there's little gain from supporting 3.0.3-3.0.5.

3.1.2 is also the first version to avoid ambiguities between Python 2
and Python 3 usage, so we finally use it as the minimum baseline.

Also test against Python 3.6 which is also our minimum supported version.
This should help prevent regressions whenever we modernize the build scripts.
2024-05-17 11:18:57 +02:00
Aaron Franke
2b2dec1f60
CI: Enable submodules on the checkout action 2024-03-15 19:53:06 -07:00
Andreia Gaita
7638a6c981 Add new VS proj generation logic that supports any platform that wants to opt in
Custom Visual Studio project generation logic that supports any platform that has a msvs.py
script, so Visual Studio can be used to run scons for any platform, with the right defines per target.

Invoked with `scons vsproj=yes`

To generate build configuration files for all platforms+targets+arch combinations, users should call

```
scons vsproj=yes platform=XXX target=YYY [other build flags]
```

for each combination of platform+target[+arch]. This will generate the relevant vs project files but
skip the build process, so that project files can be quickly generated without waiting for a command line
build. This lets project files be quickly generated even if there are build errors.

All possible combinations of platform+target are created in the solution file by default, but they
won't do anything until each one is set up with a scons vsproj=yes command for the respective platform
in the appropriate command line. This lets users only generate the combinations they need, and VS
won't have to parse settings for other combos.

Only platforms that opt in to vs proj generation by having a msvs.py file in the platform folder are included.
Platforms with a msvs.py file will be added to the solution, but only the current active platform+target+arch
will have a build configuration generated, because we only know what the right defines/includes/flags/etc are
on the active build target currently being processed by scons.

Platforms that don't support an editor target will have a dummy editor target that won't do anything on build,
but will have the files and configuration for the windows editor target.

To generate AND build from the command line, run

```
scons vsproj=yes vsproj_gen_only=no
```
2024-01-31 16:42:42 +01:00
MrBBBaiXue
ea2c6f1d0b Add a python script to install Direct3D 12 SDK components.
This makes it much faster to get started with Direct3D 12 builds,
as you only need to run `python .\misc\scripts\install_d3d12_sdk_windows.py`
then run `scons d3d12=yes`.

This installs DirectX Shader Compiler, Mesa NIR, WinPixEventRuntime
and DirectX 12 Agility SDK.

- Define a default path that uses the locations from the script.
- Now the default path is in "%LOCALAPPDATA%\Godot\build_deps\"
- Updated CI to use this new python script.

Co-Authored-By: Hugo Locurcio <hugo.locurcio@hugo.pro>
2024-01-24 20:11:43 +08:00
Pedro J. Estébanez
2f47c57385 Add Direct3D 12 RenderingDevice implementation 2023-12-12 19:10:04 +01:00
Hugo Locurcio
dec26e15b3
Use colored output on CI for Doctest
GitHub Actions output is not considered a TTY, so colored output
must be forced.
2023-10-28 09:22:36 +02:00
Rémi Verschelde
de14f1d295
CI: Bump version for actions/checkout@v4 and actions/setup-dotnet@v3 2023-09-04 16:05:57 +02:00
Yuri Sizov
deb6025781 CI: Extract godot-cpp testing into its own job
This ensures that the godot-cpp job has plenty of resources
to run its build and avoid being affected by the main build.

Additionally:
- Extract test tasks into dedicated actions.
- Upload artifacts as early as possible.
- Ensure that we check master cache before random cache.
2023-08-01 20:41:45 +02:00
Rémi Verschelde
a28c9701ed
CI: Use GODOT_BASE_BRANCH for the godot-cpp checkout 2023-05-18 16:22:25 +02:00
RedworkDE
adbb323163 CI: Fix running the unit tests on windows 2023-05-10 00:02:27 +02:00
umarcor
2abadbb58b [ci/windows] remove obsolete 'tools' in the name 2023-04-05 14:10:52 +02:00
yedpodtrzitko
93b7bcb33d ci: wait for static check results before starting builds 2023-04-04 22:05:15 +07:00
Josh Jones
ed2c1d1c51 Add MSVC problem matcher to CI 2022-11-11 13:23:59 -08:00
bruvzg
0103af1ddd
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
TechnoPorg
f124616a5f Various enhancements to Visual Studio solution generation.
This adds support for building solutions with dev_mode and/or float=64 enabled.
Additionally, it adds solution generation to the Windows CI to catch future regressions.
2022-10-04 19:10:02 -06:00
Rémi Verschelde
39facb35a0 SCons: Unify tools/target build type configuration
Implements https://github.com/godotengine/godot-proposals/issues/3371.

New `target` presets
====================

The `tools` option is removed and `target` changes to use three new presets,
which match the builds users are familiar with. These targets control the
default optimization level and enable editor-specific and debugging code:

- `editor`: Replaces `tools=yes target=release_debug`.
  * Defines: `TOOLS_ENABLED`, `DEBUG_ENABLED`, `-O2`/`/O2`
- `template_debug`: Replaces `tools=no target=release_debug`.
  * Defines: `DEBUG_ENABLED`, `-O2`/`/O2`
- `template_release`: Replaces `tools=no target=release`.
  * Defines: `-O3`/`/O2`

New `dev_build` option
======================

The previous `target=debug` is now replaced by a separate `dev_build=yes`
option, which can be used in combination with either of the three targets,
and changes the following:

- `dev_build`: Defines `DEV_ENABLED`, disables optimization (`-O0`/`/0d`),
  enables generating debug symbols, does not define `NDEBUG` so `assert()`
  works in thirdparty libraries, adds a `.dev` suffix to the binary name.

Note: Unlike previously, `dev_build` defaults to off so that users who
compile Godot from source get an optimized and small build by default.
Engine contributors should now set `dev_build=yes` in their build scripts or
IDE configuration manually.

Changed binary names
====================

The name of generated binaries and object files are changed too, to follow
this format:

`godot.<platform>.<target>[.dev][.double].<arch>[.<extra_suffix>][.<ext>]`

For example:
- `godot.linuxbsd.editor.dev.arm64`
- `godot.windows.template_release.double.x86_64.mono.exe`

Be sure to update your links/scripts/IDE config accordingly.

More flexible `optimize` and `debug_symbols` options
====================================================

The optimization level and whether to generate debug symbols can be further
specified with the `optimize` and `debug_symbols` options. So the default
values listed above for the various `target` and `dev_build` combinations
are indicative and can be replaced when compiling, e.g.:

`scons p=linuxbsd target=template_debug dev_build=yes optimize=debug`
will make a "debug" export template with dev-only code enabled, `-Og`
optimization level for GCC/Clang, and debug symbols. Perfect for debugging
complex crashes at runtime in an exported project.
2022-09-26 16:31:46 +02:00
Rémi Verschelde
ef28da8006 CI: Bump various GitHub actions to latest versions
actions/cache@v3
actions/checkout@v3
actions/upload-artifact@v3
actions/setup-dotnet@v2
actions/setup-java@v3
actions/setup-python@v4
mymindstorm/setup-emsdk@v11

Also reset cache keys as we're going to cleanup all caches.
2022-08-25 13:44:22 +02:00
Aaron Franke
27b0f18275 Unify bits, arch, and android_arch into env["arch"]
Fully removes the `bits` option and adapts the code that relied on it.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2022-08-25 11:19:20 +02:00
Jan Haller
d38d76d039 Fix exit code of --help and --version, and test them in CI
Corrects prior regression which caused ERROR output and exit code of 1.
2022-07-02 01:17:35 +02:00
Rémi Verschelde
9522032adf CI: Reduce max cache to 7 GiB, remove Windows debug symbols
GitHub Actions runners only have 14 GiB available, so we need
to keep the cache constrained.
2022-03-30 10:16:03 +02:00
Rémi Verschelde
3393b3c8d1 CI: Limit Windows cache size again, otherwise we run out of space
And force a full rebuild as the cache is now broken.
2022-03-28 16:09:15 +02:00
Rémi Verschelde
cd2e7fbc57 CI: Update to actions/cache@v3, increase cache limit to 10 GiB
And force rebuild of Linux cache which got corrupted...
2022-03-23 08:10:43 +01:00
Rémi Verschelde
c4fa301b6b
CI: Build test binaries with debug symbols, then strip
This allows having good stacktraces when the tests crash.
2021-09-22 09:31:44 +02:00
Fabio Alessandrelli
3dbf008411 [CI] Refactor CI actions, use sub-actions, matrices. 2021-09-14 12:46:16 +02:00
Max Hilbrunner
5139a19877 Fix CI after concurrency 2021-08-25 15:04:05 +02:00
Max Hilbrunner
40bb1ded7e CI: Cancel previous builds if new commit is pushed 2021-08-25 14:54:48 +02:00
Gordon MacPherson
27da2e364e Fix github actions cache server being down failing builds 2021-08-18 21:58:54 +01:00
Bartłomiej T. Listwon
b6f16671ee pywin32 is no longer necessary for SCons install
https://github.com/SCons/scons/releases/tag/4.1.0
2021-05-19 08:49:45 +02:00
Rémi Verschelde
caea551d41 CI: Build without debug symbols to reduce cache size
We often hit "Too Many Requests" errors when uploading the cache with
`actions/cache` because there's a limit of 10 GB every 5 minutes, and we can
easily go over it when we amend or merge several PRs in a short timespan.

This will make the CI artifacts less useful for debugging crashes but there's
no real way around this.
2021-02-22 11:51:55 +01:00
Gordon MacPherson
f2feefb367 Use github actions cache not my own one. 2021-02-13 16:04:57 +00:00
Rémi Verschelde
456acda57a
CI: Force building TextServer fallback
It's normally opt-in as the advanced one (CTL support) is the default,
but we need to build it to catch potential build issues.
2020-12-29 12:14:16 +01:00
Rémi Verschelde
3e3fded479
CI: Shrink Windows cache to 3GB, we run out of disk space 2020-12-04 20:06:15 +01:00
Rémi Verschelde
e18a9a2224
CI: Set debug_symbols=no for template builds
This keeps their size small and allows to compare size changes on templates
in PRs, as the template size is what is most relevant to users.

For editor builds we keep debug symbols so they can be used to debug crashes.
2020-10-22 13:03:27 +02:00
Andrii Doroshenko (Xrayez)
2946535a6f CI: Refactor build workflows to use SCONSFLAGS 2020-10-16 14:41:30 +02:00
umarcor
b8855ed732 CI: upload artifacts
Set retention-days of all artifacts to 14.
2020-10-15 20:32:16 +02:00
Rémi Verschelde
69e958b48d
CI: List contents of bin/ after build
This can be used to compare impacts on the generated files
and especially their size in PRs.
2020-10-15 19:50:49 +02:00
Hugo Locurcio
82b30f36cb
GitHub Actions: Prepend emoji to platform names for easy visual grepping 2020-08-23 15:13:36 +02:00
Andrii Doroshenko (Xrayez)
ceb338d672 CI: Show tests=yes for builds which run tests 2020-07-30 14:00:45 +03:00
Andrii Doroshenko (Xrayez)
f6465f46b4 SCons: Add tests option to enable or disable unit tests 2020-07-25 18:44:18 +03:00
RevoluPowered
579342810f t Add unit testing to Godot using DocTest and added to GitHub Actions CI
Implements exit codes into the engine so tests can return their statuses.
Ideally we don't do this, and we use FIXUP logic to 'begin' and 'end' the engine execution for tests specifically.

Since realistically we're initialising the engine here we don't want to do that, since String should not require an engine startup to test a single header.

This lowers the complexity of running the unit tests and even for
physics should be possible to implement such a fix.
2020-07-24 13:05:33 +01:00
Rémi Verschelde
2cf5ad9ea9 CI: Fix cache key and include base branch
The base branch is hardcoded as an env variable as I couldn't find a simple
way to just get either `3.2` or `master`. But it's easy to change when we
branch off from `master` to a new stable branch, which doesn't happen often.

(There's `{{github.base_ref}}` but it's probably more verbose like
`ref/heads/master`, and only valid for PRs.)
2020-07-24 08:28:43 +02:00
Gordon MacPherson
afdce1e30c Improve the cache keys to prevent clashes for the wrong type of build 2020-07-24 00:15:23 +01:00
Gordon MacPherson
3c07d0ff32 Clamp scons cache to 4096 MB 2020-07-24 00:14:03 +01:00
Aaron Franke
e5df1362df
Split CI builds into workflows for each OS 2020-07-21 15:12:16 -04:00