mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
workflow: allow skip-cache
This commit is contained in:
1 parent
8cffe19609
commit
4a7f18ba14
1 file changed
+16
-7
@@ -11,9 +11,6 @@ env:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
LICENSE_KEY: ${{ secrets.MAXMIND_KEY }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
steps:
|
||||
- name: Check out
|
||||
uses: actions/checkout@v3
|
||||
@@ -27,15 +24,25 @@ jobs:
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
|
||||
- uses: actions/cache@v3
|
||||
id: yarn-cache
|
||||
- name: skip-cache
|
||||
id: skip-cache
|
||||
uses: saulmaldonado/skip-workflow@v1
|
||||
with:
|
||||
phrase: 'skip-cache'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: actions/cache@v3
|
||||
if: ${{ steps.skip-cache.outputs.skip }}
|
||||
with: &cacheWith
|
||||
path: |
|
||||
${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
yarn.lock
|
||||
.cache
|
||||
**/tsconfig.tsbuildinfo
|
||||
key: cache-${{ github.ref }}-${{ github.sha }}
|
||||
- uses: actions/cache@v3
|
||||
if: ${{ !steps.skip-cache.outputs.skip }}
|
||||
with:
|
||||
<<: *cacheWith
|
||||
restore-keys: |
|
||||
cache-${{ github.ref }}-
|
||||
cache-
|
||||
@@ -45,6 +52,8 @@ jobs:
|
||||
git config --global user.name undefined
|
||||
git config --global user.email i@undefined.moe
|
||||
yarn
|
||||
env:
|
||||
LICENSE_KEY: ${{ secrets.MAXMIND_KEY }}
|
||||
- name: Get specific changed files
|
||||
id: ui-changed-files
|
||||
uses: tj-actions/changed-files@v23.1
|
||||
@@ -64,11 +73,11 @@ jobs:
|
||||
else
|
||||
parallel --tty -j+0 yarn ::: lint:ci build test
|
||||
fi
|
||||
env:
|
||||
PT_PROJECT_TOKEN: ${{ secrets.PT_PROJECT_TOKEN }}
|
||||
- name: Publish
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
run: node build/publish.js
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
# - name: Benchmark
|
||||
# run: yarn benchmark
|
||||
# - name: Benchmark result
|
||||
|
||||
Reference in new issue
Block a user