forked from um/web
aa6476bb2c
(cherry picked from commit cb92eed9b135c04a17389f48997c18ba81e60c3a)
73 lines
1.6 KiB
YAML
73 lines
1.6 KiB
YAML
name: Test Build
|
|
on:
|
|
push:
|
|
paths:
|
|
- "**/*.js"
|
|
- "**/*.ts"
|
|
- "**/*.vue"
|
|
- "public/**/*"
|
|
- "package-lock.json"
|
|
- "package.json"
|
|
pull_request:
|
|
branches: [ master ]
|
|
types: [ opened, synchronize, reopened ]
|
|
paths:
|
|
- "**/*.js"
|
|
- "**/*.ts"
|
|
- "**/*.vue"
|
|
- "public/**/*"
|
|
- "package-lock.json"
|
|
- "package.json"
|
|
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
build: [ legacy, modern ]
|
|
include:
|
|
- build: legacy
|
|
BUILD_ARGS: ""
|
|
BUILD_EXTENSION: true
|
|
- build: modern
|
|
BUILD_ARGS: "-- --modern"
|
|
BUILD_EXTENSION: false
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js 16.x
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: "16"
|
|
|
|
- name: Install Dependencies
|
|
run: npm ci
|
|
|
|
- name: Test Coverage
|
|
uses: ArtiomTr/jest-coverage-report-action@v2.0-rc.6
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Build
|
|
run: npm run build ${{ matrix.BUILD_ARGS }}
|
|
|
|
- name: Publish artifact
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: ${{ matrix.build }}
|
|
path: ./dist
|
|
|
|
- name: Build Extension
|
|
if: ${{ matrix.BUILD_EXTENSION }}
|
|
run: npm run make-extension
|
|
|
|
- name: Publish artifact - Extension
|
|
if: ${{ matrix.BUILD_EXTENSION }}
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: extension
|
|
path: ./dist
|