diff --git a/.github/workflows/e2e-angular-cli-workflow.yml b/.github/workflows/e2e-angular-cli-workflow.yml new file mode 100644 index 000000000..0b95f1525 --- /dev/null +++ b/.github/workflows/e2e-angular-cli-workflow.yml @@ -0,0 +1,116 @@ +on: + schedule: + - cron: '0 3 * * 5' + pull_request: + branches: + - '**' + +name: 'E2E Angular CLI with verdaccio' +jobs: +# todo: fix yarn global issue, cannot find ng +# yarn: +# name: 'yarn:angular example' +# runs-on: ubuntu-latest +# +# steps: +# - uses: actions/checkout@master +# +# - name: 'Use Node.js 10.x' +# uses: actions/setup-node@master +# with: +# node-version: 10.x +# - name: Install Dependencies +# run: yarn install --pure-lockfile +# - name: 'Run verdaccio in the background' +# run: | +# nohup node ./scripts/run-verdaccio.js & +# - name: 'Ping to verdaccio' +# run: | +# npm ping --registry http://localhost:4873 +# - name: 'Running the integration test' +# run: | +# source scripts/e2e-setup-ci.sh +# yarn init --yes +# +# yarn global add @angular/cli +# which nodemon +# ng new verdaccio-angular --interactive=false +# +# cd verdaccio-angular +# echo "registry=http://localhost:4873" > ~/.npmrc +# yarn add @angular-devkit/core@next @babel/preset-env @babel/core -D +# +# ng build --aot + npm: + name: 'npm:angular example' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + + - name: 'Use Node.js 10.x' + uses: actions/setup-node@master + with: + node-version: 10.x + - name: 'install latest npm' + run: npm i -g npm + - name: Install Dependencies + run: yarn install --pure-lockfile + - name: 'Run verdaccio in the background' + run: | + nohup node ./scripts/run-verdaccio.js & + - name: 'Ping to verdaccio' + run: | + npm ping --registry http://localhost:4873 + - name: 'Running the integration test' + run: | + source scripts/e2e-setup-ci.sh + echo "registry=http://localhost:4873" > ~/.npmrc + npm config set loglevel="http" + npm config set fetch-retries="5" + npm config set fetch-retry-factor="50" + npm config set fetch-retry-mintimeout="20000" + npm config set fetch-retry-maxtimeout="80000" + npm install -g @angular/cli + ng new verdaccio-angular --interactive=false + + cd verdaccio-angular + npm install @angular-devkit/core@next @babel/preset-env @babel/core -D + + npm run ng build --aot + +# pnpm throws errors worth to check why +# pnpm: +# name: 'pnpm:angular example' +# runs-on: ubuntu-latest +# +# steps: +# - uses: actions/checkout@master +# +# - name: 'Use Node.js 10.x' +# uses: actions/setup-node@master +# with: +# node-version: 10.x +# - name: 'install latest pnpm' +# run: npm i -g pnpm +# - name: Install Dependencies +# run: yarn install --pure-lockfile +# - name: 'Run verdaccio in the background' +# run: | +# nohup node ./scripts/run-verdaccio.js & +# - name: 'Ping to verdaccio' +# run: | +# pnpm ping --registry http://localhost:4873 +# - name: 'Running the integration test' +# run: | +# source scripts/e2e-setup-ci.sh +# pnpm init --force +# +# pnpm install -g @angular/cli +# ng new verdaccio-angular --interactive=false +# +# cd verdaccio-angular +# echo "registry=http://localhost:4873" > ~/.npmrc +# pnpm install @angular-devkit/core@next @babel/preset-env @babel/core -D +# +# pnpm run ng build --aot diff --git a/.github/workflows/e2e-gatsbyjs-cli-workflow.yml b/.github/workflows/e2e-gatsbyjs-cli-workflow.yml new file mode 100644 index 000000000..04abb9b29 --- /dev/null +++ b/.github/workflows/e2e-gatsbyjs-cli-workflow.yml @@ -0,0 +1,43 @@ +on: + schedule: + - cron: '0 3 * * 5' + pull_request: + branches: + - '**' + +name: 'E2E Gatsby.js CLI with verdaccio' +jobs: + npm: + name: 'npm:gatsby example' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + + - name: 'Use Node.js 10.x' + uses: actions/setup-node@master + with: + node-version: 10.x + - name: 'install latest npm' + run: npm i -g npm + - name: Install Dependencies + run: yarn install --pure-lockfile + - name: 'Run verdaccio in the background' + run: | + nohup node ./scripts/run-verdaccio.js & + - name: 'Ping to verdaccio' + run: | + npm ping --registry http://localhost:4873 + - name: 'Running the integration test' + run: | + source scripts/e2e-setup-ci.sh + echo "registry=http://localhost:4873" > ~/.npmrc + npm config set loglevel="http" + npm config set fetch-retries="5" + npm config set fetch-retry-factor="50" + npm config set fetch-retry-mintimeout="20000" + npm config set fetch-retry-maxtimeout="80000" + npm i -g gatsby + gatsby new my-gatsby --verbose + cd my-gatsby + npm run build diff --git a/.github/workflows/e2e-jest-workflow.yml b/.github/workflows/e2e-jest-workflow.yml new file mode 100644 index 000000000..76ccad90e --- /dev/null +++ b/.github/workflows/e2e-jest-workflow.yml @@ -0,0 +1,107 @@ +on: + schedule: + - cron: '0 3 * * 5' + pull_request: + branches: + - '**' + +name: 'E2E Jest with verdaccio' +jobs: + yarn: + name: 'yarn:jest example' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + + - name: 'Use Node.js 10.x' + uses: actions/setup-node@master + with: + node-version: 10.x + - name: Install Dependencies + run: yarn install --pure-lockfile + - name: 'Run verdaccio in the background' + run: | + nohup node ./scripts/run-verdaccio.js & + - name: 'Ping to verdaccio' + run: | + npm ping --registry http://localhost:4873 + - name: 'Running the integration test' + run: | + source scripts/e2e-setup-ci.sh + yarn init --yes + yarn add jest --registry http://localhost:4873 + + echo "it('should pass', () => { expect(true).toBeTruthy(); });" | tee pass.test.js + yarn jest pass.test.js + + yarn add left-pad --registry http://localhost:4873 --verbose + echo "const leftPad = require('left-pad'); it('should resolve a module', () => { expect(typeof leftPad).toBe('function');});" | tee module.test.js + yarn jest module.test.js + npm: + name: 'npm:jest example' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + + - name: 'Use Node.js 10.x' + uses: actions/setup-node@master + with: + node-version: 10.x + - name: 'install latest npm' + run: npm i -g npm + - name: Install Dependencies + run: yarn install --pure-lockfile + - name: 'Run verdaccio in the background' + run: | + nohup node ./scripts/run-verdaccio.js & + - name: 'Ping to verdaccio' + run: | + npm ping --registry http://localhost:4873 + - name: 'Running the integration test' + run: | + source scripts/e2e-setup-ci.sh + npm init --force + npm install jest --registry http://localhost:4873 + + echo "it('should pass', () => { expect(true).toBeTruthy(); });" | tee pass.test.js + yarn jest pass.test.js + + yarn add left-pad --registry http://localhost:4873 --verbose + echo "const leftPad = require('left-pad'); it('should resolve a module', () => { expect(typeof leftPad).toBe('function');});" | tee module.test.js + yarn jest module.test.js + pnpm: + name: 'pnpm:jest example' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + + - name: 'Use Node.js 10.x' + uses: actions/setup-node@master + with: + node-version: 10.x + - name: 'install latest pnpm' + run: npm i -g pnpm + - name: Install Dependencies + run: yarn install --pure-lockfile + - name: 'Run verdaccio in the background' + run: | + nohup node ./scripts/run-verdaccio.js & + - name: 'Ping to verdaccio' + run: | + pnpm ping --registry http://localhost:4873 + - name: 'Running the integration test' + run: | + source scripts/e2e-setup-ci.sh + pnpm init --force + pnpm install jest --registry http://localhost:4873 + + echo "it('should pass', () => { expect(true).toBeTruthy(); });" | tee pass.test.js + yarn jest pass.test.js + + yarn add left-pad --registry http://localhost:4873 --verbose + echo "const leftPad = require('left-pad'); it('should resolve a module', () => { expect(typeof leftPad).toBe('function');});" | tee module.test.js + yarn jest module.test.js + diff --git a/scripts/e2e-setup-ci.sh b/scripts/e2e-setup-ci.sh new file mode 100644 index 000000000..5b23210a4 --- /dev/null +++ b/scripts/e2e-setup-ci.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -e + +HERE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +TEMP_DIR="$(mktemp -d)" + +cd "${TEMP_DIR}" + +echo $TEMP_DIR +echo $HERE_DIR + +git config --global user.email "you@example.com" +git config --global user.name "John Doe" diff --git a/scripts/run-verdaccio.js b/scripts/run-verdaccio.js new file mode 100644 index 000000000..739f5d5be --- /dev/null +++ b/scripts/run-verdaccio.js @@ -0,0 +1,8 @@ +#!/usr/bin/env node + +// this file aims to help local debugging with hot transpilation +// it requires BABEL_ENV=registry set as env variable +require('@babel/register')({ + extensions: [".ts", ".js"] +}); +require('../src/lib/cli');