mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 16:47:26 +02:00
test: add TypeScript template to E2E test matrix (#6768)
* test: add TypeScript template to E2E test * fix * fix * fix... * exclude this * refactor
This commit is contained in:
parent
68a55f0d11
commit
bafa4711b1
2 changed files with 18 additions and 13 deletions
22
.github/workflows/tests-e2e.yml
vendored
22
.github/workflows/tests-e2e.yml
vendored
|
@ -31,8 +31,6 @@ jobs:
|
|||
run: yarn
|
||||
- name: Generate test-website project against main branch
|
||||
run: yarn test:build:website -s
|
||||
env:
|
||||
KEEP_CONTAINER: true
|
||||
- name: Install test-website project with Yarn v1
|
||||
run: yarn install
|
||||
working-directory: ../test-website
|
||||
|
@ -54,6 +52,12 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
nodeLinker: [pnp, node-modules]
|
||||
variant: [-s, -st]
|
||||
exclude:
|
||||
# Running tsc on PnP requires additional installations, which is not
|
||||
# worthwhile for a simple E2E test
|
||||
- variant: -st
|
||||
nodeLinker: pnp
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js 16
|
||||
|
@ -63,10 +67,8 @@ jobs:
|
|||
cache: yarn
|
||||
- name: Installation
|
||||
run: yarn
|
||||
- name: Generate test-website project against main branch
|
||||
run: yarn test:build:website -s
|
||||
env:
|
||||
KEEP_CONTAINER: true
|
||||
- name: Generate test-website project with ${{ matrix.variant }} against main branch
|
||||
run: yarn test:build:website ${{ matrix.variant }}
|
||||
- name: Install test-website project with Yarn Berry and nodeLinker = ${{ matrix.nodeLinker }}
|
||||
run: |
|
||||
yarn set version berry
|
||||
|
@ -92,6 +94,10 @@ jobs:
|
|||
working-directory: ../test-website
|
||||
env:
|
||||
E2E_TEST: true
|
||||
- name: Type check
|
||||
if: matrix.variant == '-st'
|
||||
run: yarn typecheck
|
||||
working-directory: ../test-website
|
||||
- name: Build test-website project
|
||||
run: yarn build
|
||||
working-directory: ../test-website
|
||||
|
@ -111,8 +117,6 @@ jobs:
|
|||
run: yarn
|
||||
- name: Generate test-website project against main branch
|
||||
run: yarn test:build:website -s
|
||||
env:
|
||||
KEEP_CONTAINER: true
|
||||
- name: Install test-website project with NPM
|
||||
run: npm install
|
||||
working-directory: ../test-website
|
||||
|
@ -142,8 +146,6 @@ jobs:
|
|||
run: yarn
|
||||
- name: Generate test-website project against main branch
|
||||
run: yarn test:build:website -s
|
||||
env:
|
||||
KEEP_CONTAINER: true
|
||||
- name: Install test-website project with PNPM
|
||||
run: |
|
||||
curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm
|
||||
|
|
|
@ -12,13 +12,16 @@ NEW_VERSION="$(node -p "require('./packages/docusaurus/package.json').version").
|
|||
CONTAINER_NAME="verdaccio"
|
||||
EXTRA_OPTS=""
|
||||
|
||||
usage() { echo "Usage: $0 [-s]" 1>&2; exit 1; }
|
||||
usage() { echo "Usage: $0 [-s] [-t]" 1>&2; exit 1; }
|
||||
|
||||
while getopts ":ns" o; do
|
||||
while getopts ":st" o; do
|
||||
case "${o}" in
|
||||
s)
|
||||
EXTRA_OPTS="${EXTRA_OPTS} --skip-install"
|
||||
;;
|
||||
t)
|
||||
EXTRA_OPTS="${EXTRA_OPTS} --typescript"
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
|
@ -52,7 +55,7 @@ cd ..
|
|||
npm_config_registry="$CUSTOM_REGISTRY_URL" npx create-docusaurus@"$NEW_VERSION" test-website classic $EXTRA_OPTS
|
||||
|
||||
# Stop Docker container
|
||||
if [[ -z "${KEEP_CONTAINER:-}" ]] && ( $(docker container inspect "$CONTAINER_NAME" > /dev/null 2>&1) ); then
|
||||
if [[ -z "${KEEP_CONTAINER:-true}" ]] && ( $(docker container inspect "$CONTAINER_NAME" > /dev/null 2>&1) ); then
|
||||
# Remove Docker container
|
||||
docker container stop $CONTAINER_NAME > /dev/null
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue