| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- 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: coverage=false
- 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 }}
|