From 68dbc9c8737eaa834438683d7093d71b1c96bc81 Mon Sep 17 00:00:00 2001 From: Ramon Brullo Date: Fri, 18 Oct 2024 11:43:23 +0200 Subject: [PATCH] ci: add verdaccio setup to e2e pipeline --- .github/workflows/e2e-verdaccio.yml | 36 ----------------------------- .github/workflows/test.yml | 21 ++++++++++++++++- 2 files changed, 20 insertions(+), 37 deletions(-) delete mode 100644 .github/workflows/e2e-verdaccio.yml diff --git a/.github/workflows/e2e-verdaccio.yml b/.github/workflows/e2e-verdaccio.yml deleted file mode 100644 index 65b7fdbc..00000000 --- a/.github/workflows/e2e-verdaccio.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: verdaccio e2e demo - -on: push - -jobs: - build: - runs-on: ubuntu-latest - name: setup verdaccio - services: - verdaccio: - image: verdaccio/verdaccio:5 - ports: - - 4873:4873 - - steps: - - uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: "22.x" - - name: login - run: npx npm-cli-login -u tester -p 123456 -e tester@example.com -r http://localhost:4873 - - name: publish - run: | - root_dir=$(pwd) - for dir in .github/verdaccio/*/; do - if [ -f "$dir/package.json" ]; then - echo "Publishing $dir" - cd "$dir" - npm publish --registry http://localhost:4873 - cd "$root_dir" - fi - done - - name: check - run: npm info com.example.demo --json --registry http://localhost:4873 - working-directory: .github/verdaccio/com.example.demo diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4c46c101..b885cfab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,7 +32,13 @@ jobs: run: npm run test:integration e2e-test: - runs-on: ${{ matrix.os }}-latest + runs-on: ubuntu-latest + container: ${{ matrix.os }}:latest + services: + verdaccio: + image: verdaccio/verdaccio:5 + ports: + - 4873:4873 strategy: matrix: os: @@ -50,6 +56,19 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} + - name: Add test user + run: npx npm-cli-login -u tester -p 123456 -e tester@example.com -r http://localhost:4873 + - name: Add test packages + run: | + root_dir=$(pwd) + for dir in .github/verdaccio/*/; do + if [ -f "$dir/package.json" ]; then + echo "Publishing $dir" + cd "$dir" + npm publish --registry http://localhost:4873 + cd "$root_dir" + fi + done - name: Install dependencies run: npm ci - name: Build