|
| 1 | +name: Compile Test |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + |
| 8 | +concurrency: |
| 9 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
| 12 | +defaults: |
| 13 | + run: |
| 14 | + shell: bash |
| 15 | + |
| 16 | +jobs: |
| 17 | + check: |
| 18 | + name: check |
| 19 | + if: github.repository == 'ynoproject/ynoengine' |
| 20 | + runs-on: ubuntu-latest |
| 21 | + steps: |
| 22 | + - name: Install dependencies |
| 23 | + run: | |
| 24 | + sudo apt-get update |
| 25 | + sudo apt-get install -yqq --no-install-recommends --no-install-suggests \ |
| 26 | + build-essential cmake ninja-build git ca-certificates ccache |
| 27 | + sudo pip3 install meson |
| 28 | +
|
| 29 | + - uses: actions/checkout@v6 |
| 30 | + - name: Checkout buildscripts |
| 31 | + uses: actions/checkout@v6 |
| 32 | + with: |
| 33 | + repository: EasyRPG/buildscripts |
| 34 | + path: buildscripts |
| 35 | + |
| 36 | + - name: Get buildscripts commit hash |
| 37 | + id: buildscripts-hash |
| 38 | + working-directory: buildscripts |
| 39 | + run: | |
| 40 | + echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT |
| 41 | +
|
| 42 | + - name: Cache Emscripten toolchain and libraries |
| 43 | + id: cache |
| 44 | + uses: actions/cache@v5 |
| 45 | + with: |
| 46 | + path: | |
| 47 | + buildscripts/emscripten/emsdk-portable |
| 48 | + buildscripts/emscripten/bin |
| 49 | + buildscripts/emscripten/lib |
| 50 | + buildscripts/emscripten/include |
| 51 | + key: easyrpg-emscripten-${{ steps.buildscripts-hash.outputs.hash }}-${{ runner.os }} |
| 52 | + restore-keys: | |
| 53 | + easyrpg-emscripten-${{ steps.buildscripts-hash.outputs.hash }}- |
| 54 | + easyrpg-emscripten- |
| 55 | +
|
| 56 | + - name: Install Player dependencies |
| 57 | + if: steps.cache.outputs.cache-hit != 'true' |
| 58 | + run: bash 0_build_everything.sh |
| 59 | + working-directory: buildscripts/emscripten |
| 60 | + env: |
| 61 | + BUILD_LIBLCF: "1" |
| 62 | + |
| 63 | + - run: cmake --preset yno-simd-release |
| 64 | + env: |
| 65 | + EASYRPG_BUILDSCRIPTS: "${{ github.workspace }}/buildscripts" |
| 66 | + - run: cmake --build --preset yno-simd-release |
| 67 | + |
| 68 | + - run: cmake --preset yno-release |
| 69 | + env: |
| 70 | + EASYRPG_BUILDSCRIPTS: "${{ github.workspace }}/buildscripts" |
| 71 | + - run: cmake --build --preset yno-release |
| 72 | + |
| 73 | + - uses: actions/upload-artifact@v4 |
| 74 | + with: |
| 75 | + name: ynoengine-wasm |
| 76 | + path: | |
| 77 | + build/yno-simd-release/ynoengine-simd.* |
| 78 | + build/yno-release/ynoengine.* |
| 79 | + if-no-files-found: warn |
0 commit comments