Skip to content

Commit

Permalink
💚 ci: 优化 ci 配置
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Feb 5, 2021
1 parent 8799639 commit c5181ba
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,25 @@ on:

jobs:
precheck:
# continue-on-error: true # Uncomment once integration is finished
continue-on-error: true # 如果这个这个 job 挂了继续往下走
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
# 这个 action 可以 cancel 掉先前运行的 action
# 使得运行的脚本始终是最新的 commit
# https://github.com/marketplace/actions/skip-duplicate-actions
uses: fkirc/skip-duplicate-actions@master
with:
# All of these options are optional, so you can remove them if you are happy with the defaults
skip_after_successful_duplicate: 'true'
paths_ignore: '["**/README.md", "**/docs/**"]'

install:
name: Install Dependencies
needs: precheck
if: needs.pre_job.outputs.should_skip != 'true'
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down Expand Up @@ -72,8 +76,8 @@ jobs:
**/node_modules
key: npm-${{ runner.os }}-${{ hashFiles('yarn.lock') }}

- name: Install
run: yarn
- name: Generate temp
run: yarn postinstall

- name: lint
run: yarn lint
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ jobs:
**/node_modules
key: npm-${{ runner.os }}-${{ hashFiles('yarn.lock') }}

- name: Install
run: yarn
- name: Generate temp
run: yarn postinstall

- name: lint
run: yarn lint
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
"--------- ": "",
"clean": "rm -rf dist release .eslintcache ./src/.umi",
"postinstall:umi-temp": "umi generate tmp",
"postinstall:rebuild": "electron-builder install-app-deps",
"postinstall": "yarn postinstall:umi-temp && yarn postinstall:rebuild && electron-builder install-app-deps",
"postuninstall": "yarn postinstall:rebuild && electron-builder install-app-deps"
"postinstall": "umi generate tmp && electron-builder install-app-deps",
"postuninstall": "electron-builder install-app-deps"
},
"lint-staged": {
"*.{js,jsx,less,md,json}": [
Expand Down

0 comments on commit c5181ba

Please sign in to comment.