Skip to content

feat: 使用环境变量UMI_DEV_SERVER_COMPRESS来控制dev server是否进行压缩 #5346

feat: 使用环境变量UMI_DEV_SERVER_COMPRESS来控制dev server是否进行压缩

feat: 使用环境变量UMI_DEV_SERVER_COMPRESS来控制dev server是否进行压缩 #5346

Workflow file for this run

name: e2e-basic
env:
NODE_OPTIONS: --max-old-space-size=6144
on:
schedule:
- cron: '0 */4 * * *'
push:
branches:
- master
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
types:
- 'opened'
- 'synchronize'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
e2e-basic:
timeout-minutes: 60
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [16.x]
os: [ubuntu-latest, windows-latest]
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/[email protected]
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org/'
- name: Setup Global Cypress-cache-folder in Windows
if: matrix.os == 'windows-latest'
run: echo "CYPRESS_CACHE_FOLDER=${HOME}\.cache\Cypress" >> $env:GITHUB_ENV
# We use week in the turbo cache key to keep the cache from infinitely growing
- name: Get cache expires mark (non-windows)
if: runner.os != 'Windows'
run: echo "EXPIRES_WEEK_MARK=$(date +%U)" >> $GITHUB_OUTPUT
- name: Get cache expires mark (windows)
if: runner.os == 'Windows'
run: echo "EXPIRES_WEEK_MARK=$(date +%U)" >> $env:GITHUB_OUTPUT
- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v3
with:
path: .turbo
key: turbo-${{ github.job }}-${{ runner.os }}-node${{ matrix.node-version }}-${{ github.ref_name }}-${{ env.EXPIRES_WEEK_MARK }}-${{ github.sha }}
restore-keys: |
turbo-${{ github.job }}-${{ runner.os }}-node${{ matrix.node-version }}-
turbo-${{ github.job }}-${{ runner.os }}-node${{ matrix.node-version }}-${{ github.ref_name }}-${{ env.EXPIRES_WEEK_MARK }}-
- name: Install dependencies
run: pnpm i
- name: Build targets
run: pnpm umi-scripts turbo build
--filter ./examples/max...
--filter ./examples/test-test/...
--filter ./packages/umi/...
- name: e2e:example:max
uses: cypress-io/github-action@v4
with:
browser: chrome
working-directory: ./examples/max
install: false
install-command: pnpm i cypress
command: npm run e2e:ci
env:
CYPRESS_RECORD_KEY: ${{secrets.CYPRESS_KEY}}
- name: e2e:example:max:dev
if: runner.os != 'Windows'
uses: cypress-io/github-action@v4
with:
browser: chrome
working-directory: ./examples/max
install: false
install-command: pnpm i cypress
command: npm run e2e:dev:ci
env:
CYPRESS_RECORD_KEY: ${{secrets.CYPRESS_KEY}}
- name: e2e:example-test-test
working-directory: ./examples/test-test
run: |
npx umi setup
pnpm test
- name: Notify Contributor Group
if: ${{ failure() && github.event.schedule == '0 */4 * * *' }}
uses: zcong1993/actions-ding@master
with:
dingToken: ${{ secrets.DING_TOKEN }}
body: ${{ format('{{"msgtype":"link","link":{{"text":"哪位好心人来看看吧!","title":"Umi CI E2E 测试失败({1})","picUrl":"","messageUrl":"https://github.com/umijs/umi/actions/runs/{0}"}}}}', github.run_id, matrix.os )}}