Skip to content

Commit

Permalink
chore: add NPM and PNPM to E2E tests (#6080)
Browse files Browse the repository at this point in the history
* chore: add NPM and PNPM to E2E tests

* Align node versions

* Install PNPM

* Fix options

Maybe fix

Fix
  • Loading branch information
Josh-Cena committed Dec 10, 2021
1 parent 991c1b2 commit 4809a1a
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 6 deletions.
73 changes: 70 additions & 3 deletions .github/workflows/tests-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['14']
nodeLinker: [pnp, node-modules]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node }}
- name: Use Node.js 16
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
node-version: '16'
cache: yarn
- name: Installation
run: yarn
Expand Down Expand Up @@ -97,3 +96,71 @@ jobs:
working-directory: ../test-website
env:
CI: true

npm:
name: E2E — NPM
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16
uses: actions/setup-node@v2
with:
node-version: '16'
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: Install test-website project with NPM
run: npm install
working-directory: ../test-website
env:
npm_config_registry: http://localhost:4873
- name: Start test-website project
run: npm run start -- --no-open
working-directory: ../test-website
env:
E2E_TEST: true
- name: Build test-website project
run: npm run build
working-directory: ../test-website
env:
CI: true

pnpm:
name: E2E — PNPM
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16
uses: actions/setup-node@v2
with:
node-version: '16'
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: Install test-website project with PNPM
run: |
curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm
pnpm install
working-directory: ../test-website
env:
npm_config_registry: http://localhost:4873
- name: Start test-website project
run: pnpm run start -- --no-open
working-directory: ../test-website
env:
E2E_TEST: true
- name: Build test-website project
run: pnpm run build
working-directory: ../test-website
env:
CI: true
6 changes: 3 additions & 3 deletions admin/scripts/test-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ usage() { echo "Usage: $0 [-n] [-s]" 1>&2; exit 1; }
while getopts ":ns" o; do
case "${o}" in
n)
EXTRA_OPTS="--use-npm"
EXTRA_OPTS="${EXTRA_OPTS} --use-npm"
;;
s)
EXTRA_OPTS="--skip-install"
EXTRA_OPTS="${EXTRA_OPTS} --skip-install"
;;
*)
usage
Expand Down Expand Up @@ -52,7 +52,7 @@ git diff --name-only -- '*.json' | sed 's, ,\\&,g' | xargs git checkout --
cd ..

# Build skeleton website with new version
npm_config_registry="$CUSTOM_REGISTRY_URL" npm init docusaurus@"$NEW_VERSION" test-website classic $EXTRA_OPTS
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
Expand Down

0 comments on commit 4809a1a

Please sign in to comment.