Skip to content

Handle pull requests from forks #14102

Handle pull requests from forks

Handle pull requests from forks #14102

name: Continuous Integration
on:
push:
branches:
- main
pull_request:
concurrency:
group: continuous-integration-${{ github.head_ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
- name: Turbo cache
if: ${{ github.ref_name != 'main' }}
id: turbo-cache
uses: actions/cache@v3
with:
path: node_modules/.cache/turbo
key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
turbo-${{ github.job }}-${{ github.ref_name }}-
- run: yarn run install-frozen-lockfile
- run: yarn svgr
- run: yarn run lint
- name: Run Coverage Report
if: '!github.event.pull_request.head.repo.fork'
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
with:
coverageCommand: xvfb-run -a yarn run cover
coverageLocations: ${{github.workspace}}/coverage/lcov.info:lcov
- name: Run Fork Coverage
if: 'github.event.pull_request.head.repo.fork'
run: xvfb-run -a yarn run cover
- name: Build Storybook
if: '!github.event.pull_request.head.repo.fork'
run: yarn build-storybook
- name: Publish to Chromatic
if: '!github.event.pull_request.head.repo.fork'
uses: chromaui/action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
storybookBuildDir: 'webview/storybook-static'
exitOnceUploaded: true
autoAcceptChanges: 'main'
onlyChanged: true
externals: '**/*.scss'