2023-02-28 12:48:49 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2023-03-05 10:09:07 +00:00
|
|
|
paths:
|
|
|
|
- src/**.scss
|
|
|
|
- package.json
|
|
|
|
- Gruntfile.coffee
|
|
|
|
- .stylelintrc
|
|
|
|
- .stylelintignore
|
2023-02-28 12:48:49 +00:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
# Test Lint
|
|
|
|
lint:
|
2023-03-03 12:54:14 +00:00
|
|
|
# Use Ubuntu 22.04 LTS
|
2023-02-28 12:48:49 +00:00
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
|
|
# Step I
|
|
|
|
- name: Get Source Code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
# Step II
|
|
|
|
- name: Setup Node.js
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
2023-03-06 14:12:09 +00:00
|
|
|
node-version: lts/*
|
2023-03-02 12:39:24 +00:00
|
|
|
registry-url: https://registry.npmjs.com
|
2023-03-01 16:07:22 +00:00
|
|
|
# Step III
|
2023-02-28 12:48:49 +00:00
|
|
|
- name: Install Dependencies
|
|
|
|
run: npm ci
|
2023-03-01 16:07:22 +00:00
|
|
|
# Step IV
|
2023-03-02 12:35:07 +00:00
|
|
|
- name: Test Lint
|
2023-02-28 12:48:49 +00:00
|
|
|
run: npm run lint
|
|
|
|
# Test Build
|
|
|
|
build:
|
|
|
|
# Use Ubuntu Linux, Windows and OS X
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-03-06 14:12:09 +00:00
|
|
|
node-version: [16, 18, latest]
|
2023-03-01 16:07:22 +00:00
|
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
2023-02-28 12:48:49 +00:00
|
|
|
fail-fast: false
|
|
|
|
steps:
|
|
|
|
# Step I
|
|
|
|
- name: Get Source Code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
# Step II
|
|
|
|
- name: Setup Node.js
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
2023-03-02 12:39:24 +00:00
|
|
|
registry-url: https://registry.npmjs.com
|
2023-02-28 12:48:49 +00:00
|
|
|
# Step III
|
|
|
|
- name: Install Dependencies
|
|
|
|
run: npm ci
|
|
|
|
# Step IV
|
|
|
|
- name: Test Build
|
|
|
|
run: npm run build
|
2023-03-02 14:52:00 +00:00
|
|
|
# Step V
|
|
|
|
- name: Upload Artifact
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: built-on__os_${{ matrix.os }}__nodejs_${{ matrix.node-version }}
|
|
|
|
path: dist/
|
|
|
|
retention-days: 3
|
|
|
|
|
2023-03-03 10:45:16 +00:00
|
|
|
# Authored by @kuohuanhuan.
|