Skip to content

Build performance

Build performance #144

name: Chromatic deploy packages/core
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check-if-should-run:
if: ${{ github.event.pull_request.draft == false }}
runs-on: ubuntu-20.04
outputs:
requireChromaticCheck: ${{ steps.diffcheck.outputs.requireChromaticCheck }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- id: diffcheck
run: |
set +e
git diff --quiet ${{ github.event.pull_request.base.sha }}..${{ github.sha }} -- packages/core/**
echo "requireChromaticCheck=$?" >> "$GITHUB_OUTPUT"
cat $GITHUB_OUTPUT
set -e
chromatic-deployment:
name: Chromatic Core
needs: check-if-should-run
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
if: ${{ needs.check-if-should-run.outputs.requireChromaticCheck == 1 }}
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js and install dependencies
if: ${{ needs.check-if-should-run.outputs.requireChromaticCheck == 1 }}
uses: ./.github/actions/install
with:
WALLET_PASSWORD: ${{ secrets.WALLET_PASSWORD_TESTNET }}
- name: Build
if: ${{ needs.check-if-should-run.outputs.requireChromaticCheck == 1 }}
run: yarn workspaces foreach -Rpt -v --from '@lace/core' run build
- name: Chromatic packages-core
if: ${{ needs.check-if-should-run.outputs.requireChromaticCheck == 1 }}
uses: ./.github/actions/chromatic
with:
DIR: packages/core
NAME: packages-core
TOKEN: ${{ secrets.CHROMATIC_LACE_CORE_TOKEN }}
- name: Skip
if: ${{ needs.check-if-should-run.outputs.requireChromaticCheck == 0 }}
run: echo "Chromatic check not needed"
exit 0