Run e2e tests on GH actions (#12517)
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com> Co-authored-by: Juan Picado <juanpicado19@gmail.com>
This commit is contained in:
parent
71417bbfcf
commit
05fa18e652
@ -115,19 +115,6 @@ jobs:
|
||||
- store_test_results: *artifact_test262_xunit
|
||||
- save_cache: *save-yarn-cache
|
||||
|
||||
publish-verdaccio:
|
||||
executor: node-executor
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache: *restore-yarn-cache
|
||||
- run: ./scripts/integration-tests/publish-local.sh
|
||||
- persist_to_workspace:
|
||||
root: /tmp/verdaccio-workspace
|
||||
paths:
|
||||
- storage
|
||||
- htpasswd
|
||||
- save_cache: *save-yarn-cache
|
||||
|
||||
publish-verdaccio-babel-8-breaking:
|
||||
executor: node-executor
|
||||
steps:
|
||||
@ -141,15 +128,7 @@ jobs:
|
||||
- htpasswd
|
||||
- save_cache: *save-yarn-cache
|
||||
|
||||
e2e-babel:
|
||||
executor: node-executor
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: /tmp/verdaccio-workspace
|
||||
- run: ./scripts/integration-tests/e2e-babel.sh
|
||||
|
||||
e2e-babel-breaking:
|
||||
e2e-breaking-babel:
|
||||
executor: node-executor
|
||||
steps:
|
||||
- checkout
|
||||
@ -157,23 +136,15 @@ jobs:
|
||||
at: /tmp/verdaccio-workspace
|
||||
- run: BABEL_8_BREAKING=true ./scripts/integration-tests/e2e-babel.sh
|
||||
|
||||
e2e-babel-old-version:
|
||||
e2e-breaking-create-react-app:
|
||||
executor: node-executor
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: /tmp/verdaccio-workspace
|
||||
- run: ./scripts/integration-tests/e2e-babel-old-version.sh
|
||||
- run: BABEL_8_BREAKING=true ./scripts/integration-tests/e2e-create-react-app.sh
|
||||
|
||||
e2e-create-react-app:
|
||||
executor: node-executor
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: /tmp/verdaccio-workspace
|
||||
- run: ./scripts/integration-tests/e2e-create-react-app.sh
|
||||
|
||||
e2e-vue-cli:
|
||||
e2e-breaking-vue-cli:
|
||||
executor: node-browsers-executor
|
||||
steps:
|
||||
- checkout
|
||||
@ -183,17 +154,9 @@ jobs:
|
||||
# vue-cli uses puppeteer, and it depends on the libXss.so.1 shared library
|
||||
name: Install Headless Chrome dependencies
|
||||
command: sudo apt-get install -yq libxss1
|
||||
- run: ./scripts/integration-tests/e2e-vue-cli.sh
|
||||
- run: BABEL_8_BREAKING=true ./scripts/integration-tests/e2e-vue-cli.sh
|
||||
|
||||
e2e-jest:
|
||||
executor: node-python-executor
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: /tmp/verdaccio-workspace
|
||||
- run: ./scripts/integration-tests/e2e-jest.sh
|
||||
|
||||
e2e-jest-breaking:
|
||||
e2e-breaking-jest:
|
||||
executor: node-python-executor
|
||||
steps:
|
||||
- checkout
|
||||
@ -238,24 +201,6 @@ workflows:
|
||||
- next-8-dev
|
||||
- next-8-rebased
|
||||
context: babel-test262
|
||||
e2e:
|
||||
jobs:
|
||||
- publish-verdaccio
|
||||
- e2e-babel:
|
||||
requires:
|
||||
- publish-verdaccio
|
||||
- e2e-babel-old-version:
|
||||
requires:
|
||||
- publish-verdaccio
|
||||
- e2e-create-react-app:
|
||||
requires:
|
||||
- publish-verdaccio
|
||||
- e2e-vue-cli:
|
||||
requires:
|
||||
- publish-verdaccio
|
||||
- e2e-jest:
|
||||
requires:
|
||||
- publish-verdaccio
|
||||
|
||||
e2e-breaking:
|
||||
jobs:
|
||||
@ -263,16 +208,16 @@ workflows:
|
||||
filters:
|
||||
branches:
|
||||
only: [main, next-8-dev, next-8-rebased]
|
||||
- e2e-babel-breaking:
|
||||
- e2e-breaking-babel:
|
||||
requires:
|
||||
- publish-verdaccio-babel-8-breaking
|
||||
- e2e-create-react-app:
|
||||
- e2e-breaking-create-react-app:
|
||||
requires:
|
||||
- publish-verdaccio-babel-8-breaking
|
||||
- e2e-vue-cli:
|
||||
- e2e-breaking-vue-cli:
|
||||
requires:
|
||||
- publish-verdaccio-babel-8-breaking
|
||||
- e2e-jest-breaking:
|
||||
- e2e-breaking-jest:
|
||||
requires:
|
||||
- publish-verdaccio-babel-8-breaking
|
||||
|
||||
@ -286,16 +231,15 @@ workflows:
|
||||
- publish-verdaccio-babel-8-breaking:
|
||||
requires:
|
||||
- approve-e2e-breaking-run
|
||||
- e2e-babel-breaking:
|
||||
- e2e-breaking-babel:
|
||||
requires:
|
||||
- publish-verdaccio-babel-8-breaking
|
||||
- e2e-create-react-app:
|
||||
- e2e-breaking-create-react-app:
|
||||
requires:
|
||||
- publish-verdaccio-babel-8-breaking
|
||||
- e2e-vue-cli:
|
||||
- e2e-breaking-vue-cli:
|
||||
requires:
|
||||
- publish-verdaccio-babel-8-breaking
|
||||
- e2e-jest-breaking:
|
||||
- e2e-breaking-jest:
|
||||
requires:
|
||||
- publish-verdaccio-babel-8-breaking
|
||||
|
||||
|
||||
52
.github/workflows/ci.yml
vendored
52
.github/workflows/ci.yml
vendored
@ -289,7 +289,7 @@ jobs:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: yarn-${{ hashFiles('yarn.lock') }}
|
||||
# See https://github.com/babel/babel/pull/12906
|
||||
- name: Workaround yarn bug
|
||||
- name: Support self-references on old Node.js
|
||||
run: |
|
||||
echo '{
|
||||
"private": true,
|
||||
@ -365,3 +365,53 @@ jobs:
|
||||
node-version: 14.2
|
||||
- name: Test Node.js 14.2
|
||||
run: yarn test:runtime:node
|
||||
|
||||
e2e-publish:
|
||||
name: Publish to local Verdaccio registry
|
||||
needs: prepare-yarn-cache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v2-beta
|
||||
with:
|
||||
node-version: "*"
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
|
||||
- name: Setup Yarn cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: yarn-${{ hashFiles('yarn.lock') }}
|
||||
- name: Publish
|
||||
run: ./scripts/integration-tests/publish-local.sh
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: verdaccio-workspace
|
||||
path: /tmp/verdaccio-workspace
|
||||
|
||||
e2e-tests:
|
||||
name: E2E
|
||||
needs: e2e-publish
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
project: [babel, babel-old-version, create-react-app, vue-cli, jest]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v2-beta
|
||||
with:
|
||||
node-version: "*"
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: verdaccio-workspace
|
||||
path: /tmp/verdaccio-workspace
|
||||
- name: Test
|
||||
run: ./scripts/integration-tests/e2e-${{ matrix.project }}.sh
|
||||
|
||||
@ -23,10 +23,13 @@ cd ../..
|
||||
startLocalRegistry "$PWD"/scripts/integration-tests/verdaccio-config.yml
|
||||
|
||||
node "$PWD"/scripts/integration-tests/utils/bump-babel-dependencies.js
|
||||
|
||||
(
|
||||
yarn why @babel/core | grep -o "@babel/core@npm:.* (via npm:.*)";
|
||||
yarn why @babel/helpers | grep -o "@babel/helpers@npm:.* (via npm:.*)";
|
||||
yarn why @babel/traverse | grep -o "@babel/traverse@npm:.* (via npm:.*)"
|
||||
# Yarn prints colors on GH actions even if it's piped, unless explicitly disabled
|
||||
# https://github.com/yarnpkg/berry/pull/659
|
||||
YARN_ENABLE_COLORS=0 yarn why @babel/core | grep -o "@babel/core@npm:.* (via npm:.*)";
|
||||
YARN_ENABLE_COLORS=0 yarn why @babel/helpers | grep -o "@babel/helpers@npm:.* (via npm:.*)";
|
||||
YARN_ENABLE_COLORS=0 yarn why @babel/traverse | grep -o "@babel/traverse@npm:.* (via npm:.*)"
|
||||
) | uniq | node -e "
|
||||
var pkg = require('./package.json');
|
||||
var packages = fs.readFileSync(0, 'utf8').trim().split('\n');
|
||||
|
||||
@ -28,10 +28,10 @@ yarn
|
||||
startLocalRegistry "$PWD"/scripts/integration-tests/verdaccio-config.yml
|
||||
loginLocalRegistry
|
||||
|
||||
# This script gets the last @babel/standalone version (because it's always published),
|
||||
# This script gets the last root package.json version,
|
||||
# and then increases by one the patch number
|
||||
VERSION=$(
|
||||
node -p "'$(npm view @babel/standalone version)'.replace(/(?<=\\d+\\.\\d+\\.)\\d+/, x => ++x)"
|
||||
node -p "require('./package.json').version.replace(/(?<=\\d+\\.\\d+\\.)\\d+/, x => ++x)"
|
||||
)
|
||||
|
||||
I_AM_USING_VERDACCIO=I_AM_SURE VERSION="$VERSION" make publish-test
|
||||
|
||||
@ -3,14 +3,14 @@
|
||||
# Copied from https://github.com/facebook/create-react-app/blob/053f9774d3f592c17741d2a86de66a7ca58f90c0/tasks/local-registry.sh
|
||||
|
||||
custom_registry_url=http://localhost:4873
|
||||
default_verdaccio_package=verdaccio@~4.3.3
|
||||
default_verdaccio_package=verdaccio@~4.11.1
|
||||
|
||||
function startLocalRegistry {
|
||||
# Start local registry
|
||||
tmp_registry_log=`mktemp`
|
||||
echo "Registry output file: $tmp_registry_log"
|
||||
(cd && nohup npx ${VERDACCIO_PACKAGE:-$default_verdaccio_package} -c $1 &>$tmp_registry_log &)
|
||||
|
||||
yarn global add verdaccio-memory@~9.7.2
|
||||
# Wait for Verdaccio to boot
|
||||
grep -q "http address" <(tail -f $tmp_registry_log)
|
||||
|
||||
|
||||
@ -22,14 +22,14 @@ uplinks:
|
||||
url: https://registry.npmjs.org/
|
||||
|
||||
packages:
|
||||
'@*/*':
|
||||
"@*/*":
|
||||
# scoped packages
|
||||
access: $all
|
||||
publish: $all
|
||||
unpublish: $all
|
||||
proxy: npmjs
|
||||
|
||||
'**':
|
||||
"**":
|
||||
# allow all users (including non-authenticated users) to read and
|
||||
# publish all packages
|
||||
#
|
||||
@ -54,7 +54,7 @@ middlewares:
|
||||
|
||||
# log settings
|
||||
logs:
|
||||
- { type: stdout, format: pretty, level: http }
|
||||
- { type: stdout, format: pretty, level: warn }
|
||||
#- {type: file, path: verdaccio.log, level: info}
|
||||
#experiments:
|
||||
# # support for npm token command
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user