From aec4e700ba752d09667afc0910ec4e6fc6c80d63 Mon Sep 17 00:00:00 2001 From: Juan Picado Date: Fri, 31 Mar 2023 08:28:41 +0200 Subject: [PATCH] chore: add test for require module (#3710) --- .../workflows/e2e-angular-cli-workflow.yml | 72 +------------------ .github/workflows/smok-test-module.yml | 46 ++++++++++++ 2 files changed, 47 insertions(+), 71 deletions(-) create mode 100644 .github/workflows/smok-test-module.yml diff --git a/.github/workflows/e2e-angular-cli-workflow.yml b/.github/workflows/e2e-angular-cli-workflow.yml index 3184b2145..b8207ec92 100644 --- a/.github/workflows/e2e-angular-cli-workflow.yml +++ b/.github/workflows/e2e-angular-cli-workflow.yml @@ -7,40 +7,6 @@ on: 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@v2.3.3 - - # - name: 'Use Node.js 14.x' - # uses: actions/setup-node@v2.1.5 - # with: - # node-version: 14.x - # - name: Install Dependencies - # run: yarn install --pure-lockfile - # - name: 'Run verdaccio in the background' - # run: | - # nohup yarn 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: 'npm6:angular example' runs-on: ubuntu-latest @@ -188,40 +154,4 @@ jobs: 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@v2.3.3 -# -# - name: 'Use Node.js 10.x' -# uses: actions/setup-node@v2.1.1 -# 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 yarn 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 -# -# 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 + npm run ng build --aot diff --git a/.github/workflows/smok-test-module.yml b/.github/workflows/smok-test-module.yml new file mode 100644 index 000000000..0baec4206 --- /dev/null +++ b/.github/workflows/smok-test-module.yml @@ -0,0 +1,46 @@ +name: Module Smoke Test 5.x +on: + workflow_dispatch: + push: + # branches: + # - 5.x +permissions: + contents: read +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3 + with: + node-version: 18 + - name: Docker test + run: | + docker run -d -it --rm --name verdaccio -p 4873:4873 verdaccio/verdaccio:5.x-next + - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2 + - name: 'Use Node.js 18.x' + uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561 # tag=v2.5.1 + with: + node-version: 18.x + - name: login + run: npx npm-cli-login -u test -p 1234 -e test@domain.test -r http://localhost:4873 + - name: Build + run: yarn build + - name: Types + run: yarn code:types + - name: Bump up package + run: npm version prerelease --no-git-tag-version --preid $(date +%s%N) + - name: publish verdaccio + run: npm publish --registry http://localhost:4873 + - name: install verdaccio + run: npm i -g verdaccio --loglevel info --registry http://localhost:4873 + - name: verdaccio version + run: verdaccio --version + - name: 'Running the integration test' + run: | + source scripts/e2e-setup-ci.sh + npm init --force + npm install jest --registry http://localhost:4873 + npm install verdaccio --registry http://localhost:4873 + echo "test('require module should works', () => { const {runServer} = require('verdaccio') });" | tee module.spec.js + cat module.spec.js + yarn jest