- Bump setup-node action to v2. - Use composite actions to reuse same setting. This is preferred over reusable templates because reusable templates are on job-level but setting up node should be a step.
56 lines
1.6 KiB
YAML
56 lines
1.6 KiB
YAML
name: build-checks
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
build-web:
|
|
strategy:
|
|
matrix:
|
|
os: [ macos, ubuntu, windows ]
|
|
mode: [ development, test, production ]
|
|
fail-fast: false # Allows to see results from other combinations
|
|
runs-on: ${{ matrix.os }}-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v2
|
|
-
|
|
name: Setup node
|
|
uses: ./.github/actions/setup-node
|
|
-
|
|
name: Install dependencies
|
|
run: npm ci
|
|
-
|
|
name: Build
|
|
run: npm run build -- --mode ${{ matrix.mode }}
|
|
|
|
# A new job is used due to environments/modes different from Vue CLI, https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/1626
|
|
build-desktop:
|
|
strategy:
|
|
matrix:
|
|
os: [ macos, ubuntu, windows ]
|
|
mode: [ development, production ] # "test" is not supported https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/1627
|
|
fail-fast: false # Allows to see results from other combinations
|
|
runs-on: ${{ matrix.os }}-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v2
|
|
-
|
|
name: Setup node
|
|
uses: ./.github/actions/setup-node
|
|
-
|
|
name: Install dependencies
|
|
run: npm ci
|
|
-
|
|
name: Install cross-env
|
|
# Used to set NODE_ENV due to https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/1626
|
|
run: npm install --global cross-env
|
|
-
|
|
name: Build
|
|
run: |-
|
|
cross-env-shell NODE_ENV=${{ matrix.mode }}
|
|
npm run electron:build -- --publish never --mode ${{ matrix.mode }}
|