perf: enhance rendering performance of SelectView #963
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: deploy-site-preview | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
push: | |
tags: | |
- '*' | |
- '!(*(beta|alpha)*)' | |
workflow_dispatch: | |
jobs: | |
build-site: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@master | |
- name: setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'yarn' | |
- name: install | |
run: yarn && cd site && yarn && cd ../ | |
- name: build components | |
run: yarn icon && yarn build:es && yarn build:css | |
- name: build site | |
run: yarn build:site | |
- name: Upload site-dist Artifact | |
uses: actions/upload-artifact@v3.1.1 | |
with: | |
name: site-dist | |
path: site/dist | |
deploy-preview: | |
runs-on: ubuntu-latest | |
needs: build-site | |
steps: | |
- name: checkout | |
uses: actions/checkout@master | |
- name: setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'yarn' | |
- name: Download site-dist Artifact | |
uses: actions/download-artifact@v3.0.1 | |
with: | |
# Artifact name | |
name: site-dist | |
# Destination path | |
path: dist/ | |
- name: netlify install | |
run: yarn add netlify-cli@16 -D | |
- name: get PreviewID | |
run: | | |
if ${{ github.event_name == 'pull_request' }}; then | |
echo "PreviewID=${{ github.event.number }}" >> $GITHUB_ENV | |
else | |
echo "PreviewID=main" >> $GITHUB_ENV | |
fi | |
- name: netlify deploy | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
run: netlify deploy --auth $NETLIFY_AUTH_TOKEN --site $NETLIFY_SITE_ID --dir=dist --alias=pr-preview-${{ env.PreviewID }} | |
add-pr-comment: | |
runs-on: ubuntu-latest | |
needs: deploy-preview | |
if: github.event_name == 'pull_request' | |
steps: | |
- name: checkout | |
uses: actions/checkout@master | |
- name: setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'yarn' | |
- name: PR Comment | |
uses: mshick/add-pr-comment@v2 | |
env: | |
PR_NUMBER: ${{ github.event.number }} | |
with: | |
# Message to comment | |
message: | | |
[📚 📚 Site Preview: https://pr-preview-${{ env.PR_NUMBER }}--arco-design.netlify.app](https://pr-preview-${{ env.PR_NUMBER }}--arco-design.netlify.app/react/docs/start) | |
image-test: | |
runs-on: ubuntu-latest | |
needs: deploy-preview | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: install | |
run: yarn | |
- name: setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'yarn' | |
- name: build:cjs | |
run: yarn icon && yarn build:cjs | |
- name: get PreviewID | |
run: | | |
if ${{ github.event_name == 'pull_request' }}; then | |
echo "PreviewID=${{ github.event.number }}" >> $GITHUB_ENV | |
else | |
echo "PreviewID=main" >> $GITHUB_ENV | |
fi | |
- name: gen screenshots | |
run: yarn run test:screenshots --domain=https://pr-preview-${{ env.PreviewID }}--arco-design.netlify.app | |
- name: upload screenshots to argos-cli | |
# run: npx @argos-ci/cli upload ./tests/__screenshots__ | |
run: yarn add @argos-ci/cli -D && yarn run argos upload ./tests/__screenshots__ |