2021-09-14 14:51:51 +08:00
|
|
|
name: CI
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- main
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
Test:
|
|
|
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os:
|
|
|
|
- windows-2019
|
|
|
|
- ubuntu-20.04
|
|
|
|
- macos-10.15
|
|
|
|
node:
|
|
|
|
- 14 # installed on the images
|
|
|
|
pnpm:
|
|
|
|
- 6
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.pnpm-store
|
|
|
|
D:\.pnpm-store
|
|
|
|
key: "setupcpp-cache-OS:${{ matrix.os }}-node:${{ matrix.node }}-pnpm:${{ matrix.pnpm }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}"
|
|
|
|
restore-keys: |
|
|
|
|
"setupcpp-cache-OS:${{ matrix.os }}"
|
|
|
|
|
|
|
|
- name: Setup Node
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
|
|
|
|
|
|
|
- name: Setup Pnpm
|
|
|
|
uses: pnpm/action-setup@v2
|
|
|
|
with:
|
|
|
|
version: ${{ matrix.pnpm }}
|
|
|
|
|
|
|
|
- name: Install and build
|
|
|
|
run: |
|
|
|
|
pnpm install
|
|
|
|
|
|
|
|
Lint:
|
|
|
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Commit lint ✨
|
|
|
|
uses: wagoid/commitlint-github-action@v2
|
|
|
|
|
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.pnpm-store
|
|
|
|
D:\.pnpm-store
|
|
|
|
key: "setupcpp-cache-OS:${{ matrix.os }}-node:${{ matrix.node }}-pnpm:${{ matrix.pnpm }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}"
|
|
|
|
restore-keys: |
|
|
|
|
"setupcpp-cache-OS:${{ matrix.os }}"
|
|
|
|
|
|
|
|
- name: Setup Node
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
|
|
|
|
|
|
|
- name: Setup Pnpm
|
|
|
|
uses: pnpm/action-setup@v2
|
|
|
|
with:
|
|
|
|
version: ${{ matrix.pnpm }}
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install
|
|
|
|
|
|
|
|
- name: Format ✨
|
|
|
|
run: pnpm run test.format
|
|
|
|
|
|
|
|
- name: Lint ✨
|
2021-09-14 15:00:41 +08:00
|
|
|
run: pnpm run test.lint
|