mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-26 01:33:02 +00:00
* ci(workflow): add 'npm' cache for actions/setup-node in .github/workflows * Use cache: yarn * Reformat Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
93 lines
2.6 KiB
YAML
93 lines
2.6 KiB
YAML
name: V2 Tests E2E
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
yarn-v1:
|
|
timeout-minutes: 30
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node: ['14', '16', '17']
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Use Node.js ${{ matrix.node }}
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
cache: yarn
|
|
- name: Installation
|
|
run: yarn
|
|
- name: Generate test-website project against main branch
|
|
run: |
|
|
KEEP_CONTAINER=true yarn test:build:website -s
|
|
mv test-website ../test-website
|
|
- name: Install test-website project with Yarn v1
|
|
run: |
|
|
cd ../test-website
|
|
yarn install
|
|
env:
|
|
npm_config_registry: http://localhost:4873
|
|
- name: Start test-website project
|
|
run: cd ../test-website && yarn start --no-open
|
|
env:
|
|
E2E_TEST: true
|
|
- name: Build test-website project
|
|
run: cd ../test-website && yarn build
|
|
env:
|
|
CI: true
|
|
|
|
yarn-berry:
|
|
timeout-minutes: 30
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node: ['14']
|
|
nodeLinker: [pnp, node-modules]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Use Node.js ${{ matrix.node }}
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
cache: yarn
|
|
- name: Installation
|
|
run: yarn
|
|
|
|
- name: Generate test-website project against main branch
|
|
run: |
|
|
KEEP_CONTAINER=true yarn test:build:website -s
|
|
mv test-website ../test-website
|
|
- name: Install test-website project with Yarn Berry and nodeLinker = ${{ matrix.nodeLinker }}
|
|
run: |
|
|
cd ../test-website
|
|
|
|
# we have to switch to berry first before setting the version we want
|
|
yarn set version berry
|
|
# temporary using canary for #5342
|
|
yarn set version canary
|
|
|
|
yarn config set nodeLinker ${{ matrix.nodeLinker }}
|
|
yarn config set pnpMode loose
|
|
yarn config set npmRegistryServer http://localhost:4873
|
|
yarn config set unsafeHttpWhitelist --json '["localhost"]'
|
|
yarn config set enableGlobalCache true
|
|
|
|
yarn install
|
|
env:
|
|
YARN_ENABLE_IMMUTABLE_INSTALLS: false # Yarn berry should create the lockfile, despite CI env
|
|
- name: Start test-website project
|
|
run: cd ../test-website && yarn start --no-open
|
|
env:
|
|
E2E_TEST: true
|
|
- name: Build test-website project
|
|
run: cd ../test-website && yarn build
|
|
env:
|
|
CI: true
|