|
| 1 | +name: Build GDExtension |
| 2 | +on: |
| 3 | + workflow_call: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + merge_group: |
| 7 | + |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + matrix: |
| 13 | + # Test a few selected combinations of parameters |
| 14 | + # See https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax |
| 15 | + include: |
| 16 | + - target: { platform: linux, arch: x86_64, os: ubuntu-22.04 } |
| 17 | + target-type: template_debug |
| 18 | + float-precision: double |
| 19 | + - target: { platform: windows, arch: x86_64, os: windows-latest } |
| 20 | + target-type: template_release |
| 21 | + float-precision: single |
| 22 | + - target: { platform: macos, arch: universal, os: macos-latest } |
| 23 | + target-type: template_debug |
| 24 | + float-precision: single |
| 25 | + - target: { platform: android, arch: arm64, os: ubuntu-22.04 } |
| 26 | + target-type: template_debug |
| 27 | + float-precision: single |
| 28 | + - target: { platform: web, arch: wasm32, os: ubuntu-22.04 } |
| 29 | + target-type: template_release |
| 30 | + float-precision: double |
| 31 | + |
| 32 | + runs-on: ${{ matrix.target.os }} |
| 33 | + steps: |
| 34 | + # Clone this repository |
| 35 | + - name: Checkout |
| 36 | + uses: actions/checkout@v4 |
| 37 | + with: |
| 38 | + submodules: true |
| 39 | + |
| 40 | + # Lint |
| 41 | + #- name: Setup clang-format |
| 42 | + # shell: bash |
| 43 | + # run: | |
| 44 | + # python -m pip install clang-format |
| 45 | + #- name: Run clang-format |
| 46 | + # shell: bash |
| 47 | + # run: | |
| 48 | + # clang-format src/** --dry-run --Werror |
| 49 | + |
| 50 | + # Add linux x86_32 toolchain |
| 51 | + - name: Install multilib support |
| 52 | + if: ${{ matrix.target.platform == 'linux' && matrix.target.arch == 'x86_32' }} |
| 53 | + run: | |
| 54 | + sudo apt-get update && sudo apt-get install -y gcc-multilib g++-multilib |
| 55 | +
|
| 56 | + # Setup dependencies |
| 57 | + - name: Setup godot-cpp |
| 58 | + uses: ./godot-cpp/.github/actions/setup-godot-cpp |
| 59 | + with: |
| 60 | + platform: ${{ matrix.target.platform }} |
| 61 | + em-version: 3.1.62 |
| 62 | + |
| 63 | + # Build GDExtension (with caches) |
| 64 | + |
| 65 | + - name: Restore .scons_cache |
| 66 | + uses: ./godot-cpp/.github/actions/godot-cache-restore |
| 67 | + with: |
| 68 | + scons-cache: ${{ github.workspace }}/.scons-cache/ |
| 69 | + cache-name: ${{ matrix.target.platform }}_${{ matrix.target.arch }}_${{ matrix.float-precision }}_${{ matrix.target-type }} |
| 70 | + |
| 71 | + - name: Build GDExtension Debug Build |
| 72 | + shell: sh |
| 73 | + env: |
| 74 | + SCONS_CACHE: ${{ github.workspace }}/.scons-cache/ |
| 75 | + run: | |
| 76 | + scons target=${{ matrix.target-type }} platform=${{ matrix.target.platform }} arch=${{ matrix.target.arch }} precision=${{ matrix.float-precision }} |
| 77 | +
|
| 78 | + - name: Save .scons_cache |
| 79 | + uses: ./godot-cpp/.github/actions/godot-cache-save |
| 80 | + with: |
| 81 | + scons-cache: ${{ github.workspace }}/.scons-cache/ |
| 82 | + cache-name: ${{ matrix.target.platform }}_${{ matrix.target.arch }}_${{ matrix.float-precision }}_${{ matrix.target-type }} |
0 commit comments