element-web-Github/.github/workflows/build.yml

50 lines
1.6 KiB
YAML
Raw Normal View History

name: Build
on:
2022-12-09 20:28:29 +08:00
pull_request: {}
push:
branches: [develop, master]
merge_group:
types: [checks_requested]
# develop pushes and repository_dispatch handled in build_develop.yaml
env:
2022-12-09 20:28:29 +08:00
# These must be set for fetchdep.sh to get the right branch
REPOSITORY: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
jobs:
2022-12-09 20:28:29 +08:00
build:
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-24.04
- windows-2022
- macos-14
isDevelop:
- ${{ github.event_name == 'push' && github.ref_name == 'develop' }}
# Skip the ubuntu-24.04 build for the develop branch as the dedicated CD build_develop workflow handles that
exclude:
- isDevelop: true
image: ubuntu-24.04
runs-on: ${{ matrix.image }}
defaults:
run:
shell: bash
2022-12-09 20:28:29 +08:00
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
2022-12-09 20:28:29 +08:00
with:
cache: "yarn"
2024-07-04 21:26:58 +08:00
node-version: "lts/*"
2023-10-19 00:26:21 +08:00
# Workaround for yarn install timeouts, especially on Windows
- run: yarn config set network-timeout 300000
2022-12-09 20:28:29 +08:00
- name: Install Dependencies
run: "./scripts/layered.sh"
2022-12-09 20:28:29 +08:00
- name: Build
run: "yarn build"