2021-11-13 04:48:52 +08:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2021-11-13 04:55:00 +08:00
|
|
|
name: CI
|
2021-11-13 04:48:52 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: 14
|
|
|
|
|
|
|
|
- name: Cache node modules
|
|
|
|
id: cacheNodeModules
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
2021-11-14 02:40:20 +08:00
|
|
|
path: '**/node_modules'
|
2021-11-13 04:48:52 +08:00
|
|
|
key: ${{ runner.os }}-cacheNodeModules-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
restore-keys: ${{ runner.os }}-cacheNodeModules-
|
|
|
|
|
2021-11-13 04:55:00 +08:00
|
|
|
- name: Install node modules (1)
|
2021-11-13 04:48:52 +08:00
|
|
|
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
|
|
|
|
run: npm install
|
|
|
|
|
2021-11-13 04:55:00 +08:00
|
|
|
- name: Install node modules (2)
|
2021-11-13 04:48:52 +08:00
|
|
|
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
|
2021-11-15 23:16:53 +08:00
|
|
|
run: npm install --prefix webpack-plugin
|
2021-11-13 04:48:52 +08:00
|
|
|
|
2021-11-15 23:34:39 +08:00
|
|
|
- name: Install Playwright
|
2021-11-15 23:25:47 +08:00
|
|
|
run: npm run playwright-install
|
|
|
|
|
2021-11-15 18:58:26 +08:00
|
|
|
- name: Check prettier
|
|
|
|
run: npm run prettier-check
|
|
|
|
|
2021-11-13 04:48:52 +08:00
|
|
|
- name: Build
|
|
|
|
run: npm run release
|
|
|
|
|
|
|
|
- name: Run unit tests
|
|
|
|
run: npm test
|
2021-11-15 22:55:37 +08:00
|
|
|
|
2021-11-16 05:16:09 +08:00
|
|
|
- name: Build webpack plugin
|
|
|
|
run: npm run compile --prefix webpack-plugin
|
|
|
|
|
|
|
|
- name: Package using webpack plugin
|
|
|
|
run: npm run smoketest --prefix webpack-plugin
|
|
|
|
|
2021-11-15 22:55:37 +08:00
|
|
|
- name: Run smoke test
|
|
|
|
run: npm run smoketest
|