v2.71.2 #4027
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: 'test:cypress' | |
on: | |
pull_request: | |
branches: [main, release, milestone**, test-cypress] | |
paths: | |
- 'cypress/**' | |
- 'packages/**' | |
- '!packages/**/__test__/**' | |
- '!packages/**/*.test.[tj]sx?' | |
- '!packages/**/*.md' | |
push: | |
branches: [main, release, milestone**, test-cypress] | |
paths: | |
- 'cypress/**' | |
- 'packages/**' | |
- '!packages/**/__test__/**' | |
- '!packages/**/*.test.[tj]sx?' | |
- '!packages/**/*.md' | |
- '.github/**/cypress.yml' | |
jobs: | |
install: | |
runs-on: ubuntu-latest | |
container: | |
# https://github.com/cypress-io/cypress-docker-images/tree/master/browsers | |
image: cypress/browsers:node-20.17.0-chrome-128.0.6613.113-1-ff-129.0.2-edge-128.0.2739.42-1 | |
if: ${{ github.repository_owner == 'DouyinFE' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install global packages | |
run: | |
npm i -g lerna@^6 | |
corepack enable | |
- name: Build storybook | |
run: | | |
yarn bootstrap | |
yarn build:lib | |
yarn build-storybook | |
- name: Save build folder | |
uses: actions/upload-artifact@v4 | |
with: | |
name: storybook-static | |
if-no-files-found: error | |
path: storybook | |
# - name: Reclaim cache directory | |
# run: chown -R 1001:1001 /github/home/.cache && echo "pwn dat cache" | |
- name: Cypress install | |
uses: cypress-io/github-action@v6 | |
with: | |
# Disable running of tests within install job | |
runTests: false | |
chrome-tests: | |
runs-on: ubuntu-latest | |
container: | |
image: cypress/browsers:node-20.17.0-chrome-128.0.6613.113-1-ff-129.0.2-edge-128.0.2739.42-1 | |
options: --user 1001 | |
needs: install | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download the build folders | |
uses: actions/download-artifact@v4 | |
with: | |
name: storybook-static | |
path: storybook | |
- name: 'Cypress Tests - Chrome' | |
uses: cypress-io/github-action@v6 | |
with: | |
# we have already installed all dependencies above | |
install: true | |
start: npx http-server -p 6006 storybook | |
wait-on: 'http://localhost:6006' | |
wait-on-timeout: 120 | |
browser: chrome | |
record: true | |
parallel: true | |
group: 'Cypress - Chrome' | |
spec: cypress/e2e/* | |
env: | |
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
# Recommended: pass the GitHub token lets this action correctly | |
# determine the unique run id necessary to re-run the checks | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# firefox-tests: | |
# runs-on: ubuntu-latest | |
# container: | |
# image: cypress/browsers:node18.12.0-chrome103-ff107 | |
# options: --user 1001 | |
# needs: install | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# - name: Download the build folders | |
# uses: actions/download-artifact@v5 | |
# with: | |
# name: storybook-static | |
# path: storybook-static | |
# - name: 'Cypress Tests - Firefox' | |
# uses: cypress-io/github-action@v5 | |
# with: | |
# # we have already installed all dependencies above | |
# install: true | |
# start: npx http-server -p 6006 storybook-static | |
# wait-on: 'http://localhost:6006' | |
# wait-on-timeout: 120 | |
# browser: firefox | |
# record: true | |
# parallel: true | |
# group: 'Cypress - Firefox' | |
# spec: cypress/e2e/* | |
# env: | |
# CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
# # Recommended: pass the GitHub token lets this action correctly | |
# # determine the unique run id necessary to re-run the checks | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |