summaryrefslogtreecommitdiff
path: root/.github/actions
diff options
context:
space:
mode:
Diffstat (limited to '.github/actions')
-rw-r--r--.github/actions/godot-build/action.yml36
-rw-r--r--.github/actions/godot-cache/action.yml22
-rw-r--r--.github/actions/godot-deps/action.yml27
-rw-r--r--.github/actions/upload-artifact/action.yml19
4 files changed, 104 insertions, 0 deletions
diff --git a/.github/actions/godot-build/action.yml b/.github/actions/godot-build/action.yml
new file mode 100644
index 0000000000..5ed64e7de2
--- /dev/null
+++ b/.github/actions/godot-build/action.yml
@@ -0,0 +1,36 @@
+name: Build Godot
+description: Build Godot with the provided options.
+inputs:
+ target:
+ description: The scons target (debug/release_debug/release).
+ default: "debug"
+ tools:
+ description: If tools are to be built.
+ default: false
+ tests:
+ description: If tests are to be built.
+ default: false
+ platform:
+ description: The Godot platform to build.
+ required: false
+ sconsflags:
+ default: ""
+ scons-cache:
+ description: The scons cache path.
+ default: "${{ github.workspace }}/.scons-cache/"
+ scons-cache-limit:
+ description: The scons cache size limit.
+ default: 4096
+runs:
+ using: "composite"
+ steps:
+ - name: Scons Build
+ shell: sh
+ env:
+ SCONSFLAGS: ${{ inputs.sconsflags }}
+ SCONS_CACHE: ${{ inputs.scons-cache }}
+ SCONS_CACHE_LIMIT: ${{ inputs.scons-cache-limit }}
+ run: |
+ echo "Building with flags:" ${{ env.SCONSFLAGS }}
+ scons p=${{ inputs.platform }} target=${{ inputs.target }} tools=${{ inputs.tools }} tests=${{ inputs.tests }} --jobs=2 ${{ env.SCONSFLAGS }}
+ ls -l bin/
diff --git a/.github/actions/godot-cache/action.yml b/.github/actions/godot-cache/action.yml
new file mode 100644
index 0000000000..db14a0b97a
--- /dev/null
+++ b/.github/actions/godot-cache/action.yml
@@ -0,0 +1,22 @@
+name: Setup Godot build cache
+description: Setup Godot build cache.
+inputs:
+ cache-name:
+ description: The cache base name (job name by default).
+ default: "${{github.job}}"
+ scons-cache:
+ description: The scons cache path.
+ default: "${{github.workspace}}/.scons-cache/"
+runs:
+ using: "composite"
+ steps:
+ # Upload cache on completion and check it out now
+ - name: Load .scons_cache directory
+ uses: actions/cache@v2
+ with:
+ path: ${{inputs.scons-cache}}
+ key: ${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
+ restore-keys: |
+ ${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
+ ${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
+ ${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}
diff --git a/.github/actions/godot-deps/action.yml b/.github/actions/godot-deps/action.yml
new file mode 100644
index 0000000000..ee4d7d3751
--- /dev/null
+++ b/.github/actions/godot-deps/action.yml
@@ -0,0 +1,27 @@
+name: Setup python and scons
+description: Setup python, install the pip version of scons.
+inputs:
+ python-version:
+ description: The python version to use.
+ default: "3.x"
+ python-arch:
+ description: The python architecture.
+ default: "x64"
+runs:
+ using: "composite"
+ steps:
+ # Use python 3.x release (works cross platform)
+ - name: Set up Python 3.x
+ uses: actions/setup-python@v2
+ with:
+ # Semantic version range syntax or exact version of a Python version
+ python-version: ${{ inputs.python-version }}
+ # Optional - x64 or x86 architecture, defaults to x64
+ architecture: ${{ inputs.python-arch }}
+
+ - name: Setup scons
+ shell: bash
+ run: |
+ python -c "import sys; print(sys.version)"
+ python -m pip install scons
+ scons --version
diff --git a/.github/actions/upload-artifact/action.yml b/.github/actions/upload-artifact/action.yml
new file mode 100644
index 0000000000..bc1871b914
--- /dev/null
+++ b/.github/actions/upload-artifact/action.yml
@@ -0,0 +1,19 @@
+name: Upload Godot artifact
+description: Upload the Godot artifact.
+inputs:
+ name:
+ description: The artifact name.
+ default: "${{ github.job }}"
+ path:
+ description: The path to upload.
+ required: true
+ default: "bin/*"
+runs:
+ using: "composite"
+ steps:
+ - name: Upload Godot Artifact
+ uses: actions/upload-artifact@v2
+ with:
+ name: ${{ inputs.name }}
+ path: ${{ inputs.path }}
+ retention-days: 14