mirror of https://github.com/halo-dev/halo-admin
parent
d0b72738da
commit
ccffcd7261
|
@ -18,23 +18,33 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [14.x, 16.x]
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install pnpm
|
- name: Use Node.js 16
|
||||||
uses: pnpm/action-setup@v2.0.1
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
version: 7.1.6
|
node-version: 16
|
||||||
|
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- uses: pnpm/action-setup@v2.0.1
|
||||||
uses: actions/setup-node@v2
|
name: Install pnpm
|
||||||
|
id: pnpm-install
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
version: 7
|
||||||
cache: 'pnpm'
|
run_install: false
|
||||||
|
|
||||||
|
- name: Get pnpm store directory
|
||||||
|
id: pnpm-cache
|
||||||
|
run: |
|
||||||
|
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
|
||||||
|
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
name: Setup pnpm cache
|
||||||
|
with:
|
||||||
|
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
|
||||||
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-pnpm-store-
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install
|
run: pnpm install
|
||||||
|
@ -42,24 +52,44 @@ jobs:
|
||||||
run: pnpm build:packages
|
run: pnpm build:packages
|
||||||
- name: Run code lint check
|
- name: Run code lint check
|
||||||
run: pnpm lint
|
run: pnpm lint
|
||||||
- name: Run unit test
|
|
||||||
run: pnpm test:unit
|
|
||||||
- name: Run typescript type check
|
- name: Run typescript type check
|
||||||
run: pnpm typecheck
|
run: pnpm typecheck
|
||||||
|
- name: Run unit test
|
||||||
|
run: pnpm test:unit
|
||||||
|
|
||||||
github-release:
|
github-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: check
|
needs: check
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- name: Use Node.js 16
|
- name: Use Node.js 16
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16'
|
node-version: 16
|
||||||
- name: Install pnpm package manager
|
|
||||||
run: npm install -g pnpm
|
- uses: pnpm/action-setup@v2.0.1
|
||||||
|
name: Install pnpm
|
||||||
|
id: pnpm-install
|
||||||
|
with:
|
||||||
|
version: 7
|
||||||
|
run_install: false
|
||||||
|
|
||||||
|
- name: Get pnpm store directory
|
||||||
|
id: pnpm-cache
|
||||||
|
run: |
|
||||||
|
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
|
||||||
|
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
name: Setup pnpm cache
|
||||||
|
with:
|
||||||
|
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
|
||||||
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-pnpm-store-
|
||||||
|
|
||||||
- run: pnpm install
|
- run: pnpm install
|
||||||
|
- run: pnpm build:packages
|
||||||
- name: Build for release
|
- name: Build for release
|
||||||
run: pnpm build
|
run: pnpm build
|
||||||
- name: Compress dist directory
|
- name: Compress dist directory
|
||||||
|
|
Loading…
Reference in New Issue