chore(ci): cache build packages dist on ci jobs (#3335)

This commit is contained in:
Xin Du (Clark) 2022-02-21 10:26:51 +00:00 committed by GitHub
parent 16e2a54528
commit f1b84ac14a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,6 +9,33 @@ on:
- main - main
jobs: jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node: [14]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- name: Install dependencies
run: yarn --immutable
- name: Build
run: yarn build
- name: Cache dist
uses: actions/cache@v2
with:
path: packages/*/dist
key: ${{ matrix.os }}-node-v${{ matrix.node }}-${{ github.sha }}
lint: lint:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -85,6 +112,8 @@ jobs:
run: yarn test:fixtures:webpack run: yarn test:fixtures:webpack
test-types: test-types:
needs:
- build
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
@ -102,8 +131,11 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: yarn --immutable run: yarn --immutable
- name: Build - name: Restore dist cache
run: yarn build uses: actions/cache@v2
with:
path: packages/*/dist
key: ${{ matrix.os }}-node-v${{ matrix.node }}-${{ github.sha }}
- name: Test (types) - name: Test (types)
run: yarn test:types run: yarn test:types
@ -111,6 +143,7 @@ jobs:
build-release: build-release:
needs: needs:
- lint - lint
- build
- test-fixtures - test-fixtures
- test-fixtures-webpack - test-fixtures-webpack
- test-types - test-types
@ -131,8 +164,11 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: yarn --immutable run: yarn --immutable
- name: Build - name: Restore dist cache
run: yarn build uses: actions/cache@v2
with:
path: packages/*/dist
key: ${{ matrix.os }}-node-v${{ matrix.node }}-${{ github.sha }}
- name: Release Edge - name: Release Edge
if: | if: |