Skip to content

Commit

Permalink
chore: ci update
Browse files Browse the repository at this point in the history
  • Loading branch information
yinkaihui committed Mar 1, 2024
1 parent 9d7334c commit ea48a7f
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 45 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deploy-site-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: deploy-site-preview
on:
pull_request:
types: [opened, synchronize, reopened]
workflow_run:
workflows: [npm-publish]
types:
- completed

push:
tags:
- .*

workflow_dispatch:

Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: pr-build
on:
workflow_call:

jobs:
compile-build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master

- name: install
run: yarn run dependencies
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'

- name: cache build
id: cache-build
uses: actions/cache@v3
with:
key: cache-build-${{ github.sha }}
path: |
icon
hooks
es
dist
lib
- name: yarn build
if: steps.cache-es.outputs.cache-hit != 'true'
run: yarn icon && yarn build
74 changes: 74 additions & 0 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: pr-test
on:
pull_request:
types: [opened, synchronize, reopened]

workflow_dispatch:

jobs:
prepare-build:
uses: ./.github/workflows/pr-build.yml

test-client:
needs: ['prepare-build']
runs-on: ubuntu-latest
strategy:
matrix:
reactVersion: [16, 17, 18]

steps:
- name: checkout
uses: actions/checkout@master

- name: install
run: yarn run dependencies

- name: setup node
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'

- name: restore build
uses: actions/cache@v3
with:
key: cache-build-${{ github.sha }}
path: ./

- name: install react ${{ matrix.reactVersion }}
run: yarn add react@${{matrix.reactVersion}} react-dom@${{matrix.reactVersion}}

- name: test:client ${{ matrix.reactVersion }}
run: yarn test:client

test-node:
needs: ['prepare-build']
runs-on: ubuntu-latest
strategy:
matrix:
reactVersion: [16, 17, 18]

steps:
- name: checkout
uses: actions/checkout@master

- name: install
run: yarn run dependencies

- name: setup node
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'

- name: restore build
uses: actions/cache@v3
with:
key: cache-build-${{ github.sha }}
path: ./

- name: install react ${{ matrix.reactVersion }}
run: yarn add react@${{matrix.reactVersion}} react-dom@${{matrix.reactVersion}}

- name: test:node ${{ matrix.reactVersion }}
run: yarn test:node
41 changes: 0 additions & 41 deletions .github/workflows/pr_check.yml

This file was deleted.

0 comments on commit ea48a7f

Please sign in to comment.