diff --git a/.github/actions/web-deps/action.yml b/.github/actions/web-deps/action.yml new file mode 100644 index 000000000..9cf8aea12 --- /dev/null +++ b/.github/actions/web-deps/action.yml @@ -0,0 +1,18 @@ +name: Setup Base Dependencies +description: Setup Emscripten +runs: + using: "composite" + steps: + - name: Set up Emscripten latest + uses: mymindstorm/setup-emsdk@v14 + env: + EM_VERSION: 3.1.64 + EM_CACHE_FOLDER: emsdk-cache + with: + version: ${{ env.EM_VERSION }} + actions-cache-folder: ${{ env.EM_CACHE_FOLDER }} + cache-key: emsdk-${{ matrix.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }} + + - name: Verify Emscripten setup + run: | + emcc -v diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 70d1a32b4..b4f61975d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,13 +23,13 @@ jobs: - identifier: linux platform: linux name: 🐧 Linux - runner: ubuntu-20.04 + runner: ubuntu-latest arch: x86_64 - identifier: windows platform: windows name: πŸͺŸ Windows - runner: ubuntu-20.04 + runner: ubuntu-latest arch: x86_64 - identifier: macos @@ -44,17 +44,17 @@ jobs: runner: macos-latest arch: universal - - identifier: android-arm64 + - identifier: android platform: android - name: πŸ€– Android Arm64 - runner: ubuntu-20.04 - arch: arm64 + name: πŸ€– Android Arm + runner: ubuntu-latest + arch: [arm64, arm32] - - identifier: android-arm32 - platform: android - name: πŸ€– Android Arm32 - runner: ubuntu-20.04 - arch: arm32 + - identifier: web + platform: web + name: 🌐 Web + runner: ubuntu-latest + threads: [yes, no] steps: - name: Checkout Terrain3D @@ -73,6 +73,10 @@ jobs: ndk-version: r23c link-to-sdk: true + - name: Setup Web Dependencies + if: ${{ matrix.platform == 'web' }} + uses: ./.github/actions/web-deps + - name: Setup Base Dependencies uses: ./.github/actions/base-deps @@ -84,12 +88,14 @@ jobs: - name: Build Terrain3D env: + if: ${{ matrix.platform != 'web' }} SCONS_CACHE: "${{ github.workspace }}/.scons-cache/" TARGET: 'template_${{ matrix.target }}' - ARCH: '${{ matrix.arch }}' + ARCH: 'arch=${{ matrix.arch }}' + THREADS: 'threads=${{ matrix.threads }}' shell: sh run: | - scons target=$TARGET platform='${{ matrix.platform }}' arch=$ARCH debug_symbols=no -j2 + scons target=$TARGET platform='${{ matrix.platform }}' $ARCH $THREADS debug_symbols=no -j2 - name: Strip Libraries (Windows/Linux) if: ${{ matrix.platform == 'windows' || matrix.platform == 'linux' }} diff --git a/.github/workflows/web.yml b/.github/workflows/web.yml index 231790a33..38db4adfd 100644 --- a/.github/workflows/web.yml +++ b/.github/workflows/web.yml @@ -1,10 +1,10 @@ ο»Ώname: 🌐 Web Builds -on: [ workflow_call, workflow_dispatch ] +on: [ push, workflow_call, workflow_dispatch ] jobs: build: name: 🌐 Web ${{ matrix.arch }} ${{ matrix.target }} - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: @@ -14,32 +14,28 @@ jobs: #threads: [yes, no] steps: - - name: Set up Emscripten latest - uses: mymindstorm/setup-emsdk@v14 - env: - EM_VERSION: 3.1.64 - EM_CACHE_FOLDER: emsdk-cache - with: - version: ${{ env.EM_VERSION }} - actions-cache-folder: ${{ env.EM_CACHE_FOLDER }} - cache-key: emsdk-${{ matrix.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }} - - - name: Verify Emscripten setup - run: | - emcc -v - - name: Checkout Terrain3D uses: actions/checkout@v4 with: submodules: recursive + - name: Setup Web Dependencies + if: ${{ matrix.platform == 'web' }} + uses: ./.github/actions/web-deps + - name: Setup Base Dependencies uses: ./.github/actions/base-deps + # - name: Setup Build Cache + # uses: ./.github/actions/build-cache + # with: + # cache-name: ${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.threads }} + # continue-on-error: true + - name: Setup Build Cache uses: ./.github/actions/build-cache with: - cache-name: ${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.threads }} + cache-name: ${{ matrix.identifier }}-${{ matrix.target }} continue-on-error: true - name: Build Terrain3D diff --git a/Terrain3D.vcxproj b/Terrain3D.vcxproj index 878d4bb75..1d85d0693 100644 --- a/Terrain3D.vcxproj +++ b/Terrain3D.vcxproj @@ -174,6 +174,7 @@ + diff --git a/doc/docs/platforms.md b/doc/docs/platforms.md index c4a690031..8fb09d19c 100644 --- a/doc/docs/platforms.md +++ b/doc/docs/platforms.md @@ -108,10 +108,7 @@ Further reading: ## WebGL -The Terrain3D library can be exported to WebGL, however the terrain will not currently render. It requires the [Compatibility Renderer (read more)](#compatibility), which is now supported, and but there are some additional shader elements that need to be sorted out before it will work. - -Further reading: -* [Issue 502](https://github.com/TokisanGames/Terrain3D/issues/502) +Web Exports are very experimental. We have a working test environment. It requires [Compatibility Renderer (read more)](#compatibility). See the progress and setup in [Issue 502](https://github.com/TokisanGames/Terrain3D/issues/502). Supported Renderers