2022-07-15 21:53:21 +08:00
|
|
|
name: Build
|
2022-05-16 22:23:44 +08:00
|
|
|
on:
|
|
|
|
pull_request: {}
|
|
|
|
push:
|
2023-10-13 21:38:51 +08:00
|
|
|
branches: [develop, master]
|
2024-01-08 20:35:42 +08:00
|
|
|
merge_group:
|
|
|
|
types: [checks_requested]
|
2022-05-16 22:23:44 +08:00
|
|
|
# develop pushes and repository_dispatch handled in build_develop.yaml
|
|
|
|
env:
|
|
|
|
# These must be set for fetchdep.sh to get the right branch
|
|
|
|
REPOSITORY: ${{ github.repository }}
|
|
|
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
|
|
jobs:
|
|
|
|
build:
|
2023-10-13 21:38:51 +08:00
|
|
|
name: "Build on ${{ matrix.image }}"
|
|
|
|
# We build on all 3 platforms to ensure we don't have any OS-specific build incompatibilities
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
image:
|
|
|
|
- ubuntu-latest
|
|
|
|
- windows-latest
|
|
|
|
- macos-latest
|
|
|
|
isDevelop:
|
|
|
|
- ${{ github.event_name == 'push' && github.ref_name == 'develop' }}
|
|
|
|
# Skip the ubuntu-latest build for the develop branch as the dedicated CD build_develop workflow handles that
|
|
|
|
exclude:
|
|
|
|
- isDevelop: true
|
|
|
|
image: ubuntu-latest
|
|
|
|
runs-on: ${{ matrix.image }}
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
2022-05-16 22:23:44 +08:00
|
|
|
steps:
|
2023-09-06 01:31:32 +08:00
|
|
|
- uses: actions/checkout@v4
|
2022-05-16 22:23:44 +08:00
|
|
|
|
2023-11-01 02:42:07 +08:00
|
|
|
- uses: actions/setup-node@v4
|
2022-05-16 22:23:44 +08:00
|
|
|
with:
|
|
|
|
cache: "yarn"
|
2024-07-04 21:26:58 +08:00
|
|
|
node-version: "lts/*"
|
2022-05-16 22:23:44 +08:00
|
|
|
|
2023-10-19 00:26:21 +08:00
|
|
|
# Workaround for yarn install timeouts, especially on Windows
|
|
|
|
- run: yarn config set network-timeout 300000
|
|
|
|
|
2022-05-16 22:23:44 +08:00
|
|
|
- name: Install Dependencies
|
|
|
|
run: "./scripts/layered.sh"
|
|
|
|
|
2022-07-15 21:53:21 +08:00
|
|
|
- name: Build
|
|
|
|
run: "yarn build"
|