Skip to content

Commit

Permalink
FIrst attempt at build file
Browse files Browse the repository at this point in the history
  • Loading branch information
Dudejoe870 committed Apr 3, 2024
1 parent c58991f commit 1b119a8
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
on:
push:
branches: [ $default-branch ]
pull_request:
branches: [ $default-branch ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
build-type: [Release, Debug]
compilers:
- { cc: "gcc", cxx: "g++", mingw: 'false' }
- { cc: "x86_64-w64-mingw32-gcc", cxx: "x86_64-w64-mingw32-g++", mingw: 'true' }
steps:
- name: Checkout Repository
uses: actions/[email protected]

- name: Install MinGW
if: matrix.compilers.mingw == 'true'
uses: egor-tensin/[email protected]
with:
cc: 0

- name: Restore godot-cpp
id: cache-godot-restore
uses: actions/cache/[email protected]
with:
path: ${{ github.workspace }}/godot-cpp
key: ${{ matrix.compilers.cxx }}-${{ hashFiles('.gitmodules') }}-${{ matrix.build-type }}

- name: Update submodules
if: steps.cache-godot-restore.outputs.cache-hit != 'true'
uses: actions/[email protected]
with:
submodules: recursive

- name: Install CMake
uses: lukka/get-cmake@latest

- name: Build godot-cpp
if: steps.cache-godot-restore.outputs.cache-hit != 'true'
uses: ashutoshvarma/action-cmake-build@master
with:
source-dir: ${{ github.workspace }}/godot-cpp
build-dir: ${{ github.workspace }}/godot-cpp/build
cc: ${{ matrix.compilers.cc }}
cxx: ${{ matrix.compilers.cxx }}
configure-options: -G Ninja
build-type: ${{ matrix.build-type }}

- name: Setup godot-cpp Environment
if: steps.cache-godot-restore.outputs.cache-hit != 'true'
run:
mkdir "${{ github.workspace }}/godot-cpp/bin"
mkdir "${{ github.workspace }}/godot-cpp/gen"
cp -r "${{ github.workspace }}/godot-cpp/build/bin" "${{ github.workspace }}/godot-cpp/bin"
cp -r "${{ github.workspace }}/godot-cpp/build/gen" "${{ github.workspace }}/godot-cpp/gen"

- name: Save godot-cpp
id: cache-godot-save
uses: actions/cache/[email protected]
with:
path: ${{ github.workspace }}/godot-cpp
key: ${{ steps.cache-godot-restore.outputs.cache-primary-key }}

- name: Build with CMake
uses: ashutoshvarma/action-cmake-build@master
with:
build-dir: ${{ github.workspace }}/build
cc: ${{ matrix.compilers.cc }}
cxx: ${{ matrix.compilers.cxx }}
configure-options: -G Ninja
build-type: ${{ matrix.build-type }}

- name: Upload Addon Artifact
uses: actions/[email protected]
with:
path: ${{ github.workspace }}/addons

0 comments on commit 1b119a8

Please sign in to comment.