Skip to content

Commit

Permalink
test: add TypeScript template to E2E test matrix (#6768)
Browse files Browse the repository at this point in the history
* test: add TypeScript template to E2E test

* fix

* fix

* fix...

* exclude this

* refactor
  • Loading branch information
Josh-Cena authored Feb 27, 2022
1 parent 68a55f0 commit bafa471
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/tests-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions admin/scripts/test-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
;;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bafa471

Please sign in to comment.