This repository has been archived by the owner on Dec 15, 2023. It is now read-only.
docs: change to vue3 #3402
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: Visual Tests | |
on: | |
push: | |
branches: [ staging, staging-vue3 ] | |
pull_request: | |
types: [ labeled, synchronize, opened ] | |
env: | |
NODE_MODULES_CACHE_VERSION: v3 | |
jobs: | |
prompt_for_label: | |
if: (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'no-visual-test') && !contains(github.event.pull_request.labels.*.name, 'visual-test-ready')) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/github-script@v6 | |
with: | |
script: | | |
throw "Please add either the visual-test-ready or no-visual-test label to this PR depending on whether you want to run visual tests or not. It is recommended to run visual tests if your PR changes any UI."; | |
visual_tests: | |
if: contains(github.event.pull_request.labels.*.name, 'visual-test-ready') || github.event_name == 'push' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out branch | |
uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '20' | |
- name: Install Library Dependencies | |
run: npm ci | |
- name: Build Storybook | |
run: npm run storybook:build | |
- name: Run Visual Tests | |
env: | |
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} | |
PERCY_TARGET_BRANCH: ${{ github.base_ref }} | |
run: npx percy storybook --disable-cache --config percy.config.cjs --verbose ./storybook-static |