From 47e6ce9083a7af3cb137530708324d9b2ae0f06d Mon Sep 17 00:00:00 2001 From: Juan Picado Date: Thu, 28 Nov 2024 10:53:05 +0100 Subject: [PATCH] chore: reuse workflows configurations (#4965) * build test test test Update action.yml Update action.yml test test Update action.yml Update action.yml Update action.yml test test Update ci.yml Update ci.yml test test test test Update action.yml test Update ci.yml Update e2e-ci.yml test * Update ci.yml * Update plugin-generator-e2e.yaml * test * test * test * test * Update e2e-ci.yml * Update e2e-ui.yml * test * Update ci.yml * Update ci.yml * Update action.yml * Update action.yml * Update package.json * Update static-data.yml * Update static-data.yml * Update website.yml * test * Update ui-components.yml * Update ui-components.yml * Update ui-components.yml --- .github/actions/build-app/action.yml | 22 +++ .github/actions/cache-packages/action.yml | 12 ++ .github/actions/cache-store/action.yml | 15 ++ .github/actions/install-app-node/action.yml | 50 ++++++ .github/actions/install-app/action.yml | 39 +++++ .github/workflows/ci.yml | 87 ++--------- .github/workflows/e2e-ci.yml | 162 ++++---------------- .github/workflows/e2e-ui.yml | 17 +- .github/workflows/plugin-generator-e2e.yaml | 24 +-- .github/workflows/static-data.yml | 12 +- .github/workflows/ui-components.yml | 25 +-- .github/workflows/website.yml | 27 +--- e2e/ui/package.json | 3 +- 13 files changed, 212 insertions(+), 283 deletions(-) create mode 100644 .github/actions/build-app/action.yml create mode 100644 .github/actions/cache-packages/action.yml create mode 100644 .github/actions/cache-store/action.yml create mode 100644 .github/actions/install-app-node/action.yml create mode 100644 .github/actions/install-app/action.yml diff --git a/.github/actions/build-app/action.yml b/.github/actions/build-app/action.yml new file mode 100644 index 000000000..93411a9cc --- /dev/null +++ b/.github/actions/build-app/action.yml @@ -0,0 +1,22 @@ +name: 'Build app' +description: 'build verdaccio application' + +inputs: + registry-url: + description: 'Registry URL for pnpm' + required: false + default: 'http://localhost:4873' + node-version: + description: 'Node.js version to use' + required: true + +runs: + using: composite + steps: + - name: Install dependencies with a custom registry version ${{ inputs.node-version }} + uses: ./.github/actions/install-app-node + with: + node-version: ${{ inputs.node_version }} + - name: build + run: pnpm build + shell: bash diff --git a/.github/actions/cache-packages/action.yml b/.github/actions/cache-packages/action.yml new file mode 100644 index 000000000..1eb0caecf --- /dev/null +++ b/.github/actions/cache-packages/action.yml @@ -0,0 +1,12 @@ +name: 'Cache packages' +description: 'get or set cache packages' + +runs: + using: composite + steps: + - name: Cache Packages + id: cache-packages + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2 + with: + path: ./packages/ + key: pkg-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }} diff --git a/.github/actions/cache-store/action.yml b/.github/actions/cache-store/action.yml new file mode 100644 index 000000000..82cb073a6 --- /dev/null +++ b/.github/actions/cache-store/action.yml @@ -0,0 +1,15 @@ +name: 'Cache build' +description: 'get or set cache build' + +runs: + using: composite + steps: + - name: Cache .pnpm-store + id: cache-npm + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2 + with: + path: ~/.pnpm-store + key: pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.event.pull_request.number }}-${{ runner.os }} + restore-keys: | + pnpm- + diff --git a/.github/actions/install-app-node/action.yml b/.github/actions/install-app-node/action.yml new file mode 100644 index 000000000..977cdd95f --- /dev/null +++ b/.github/actions/install-app-node/action.yml @@ -0,0 +1,50 @@ +name: 'Install app with Node specific version' +description: 'install application' + +inputs: + registry-url: + description: 'Registry URL for pnpm' + required: false + default: 'http://localhost:4873' + reporter: + description: 'Reporter for pnpm' + required: false + default: 'silent' + loglevel: + description: 'Log level for pnpm' + required: false + default: 'error' + node-version: + description: 'Node.js version to use' + required: true + +runs: + using: composite + steps: + - name: Use Node + uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + with: + node-version: ${{ inputs.node-version }} + - name: Install pnpm + run: | + corepack enable + corepack prepare + shell: bash + - name: set store + run: | + if [ ! -d "$HOME/.pnpm-store" ]; then + mkdir -p $HOME/.pnpm-store + pnpm config set store-dir $HOME/.pnpm-store + else + echo "Store directory already exists. Skipping configuration." + fi + shell: bash + - name: Restore cache pnpm store + uses: ./.github/actions/cache-store + - name: Install + run: pnpm install --reporter=${{inputs.reporter}} --ignore-scripts --registry ${{ inputs.registry-url }} --loglevel=${{ inputs.loglevel }} + shell: bash + - name: Save cache pnpm store + if: steps.cache-npm.outputs.cache-hit == 'false' + uses: ./.github/actions/cache-store + diff --git a/.github/actions/install-app/action.yml b/.github/actions/install-app/action.yml new file mode 100644 index 000000000..c483a4e87 --- /dev/null +++ b/.github/actions/install-app/action.yml @@ -0,0 +1,39 @@ +name: 'Install app' +description: 'install application' + +inputs: + registry-url: + description: 'Registry URL for pnpm' + required: false + default: 'http://localhost:4873' + reporter: + description: 'Reporter for pnpm' + required: false + default: 'silent' + +runs: + using: composite + steps: + - name: Use Node + uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + with: + node-version-file: '.nvmrc' + - name: Install pnpm + run: | + corepack enable + corepack prepare + shell: bash + - name: set store + run: | + mkdir ~/.pnpm-store + pnpm config set store-dir ~/.pnpm-store + shell: bash + - name: Restore cache pnpm store + uses: ./.github/actions/cache-store + - name: Install + run: pnpm install --reporter=${{inputs.reporter}} --ignore-scripts --registry ${{ inputs.registry-url }} + shell: bash + - name: Save cache pnpm store + if: steps.cache-npm.outputs.cache-hit == 'false' + uses: ./.github/actions/cache-store + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0db330051..8927c38ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ permissions: contents: read concurrency: group: ci-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: true jobs: prepare: @@ -29,52 +29,25 @@ jobs: - 4873:4873 env: NODE_ENV: production + options: >- + --health-cmd="curl -f http://0.0.0.0:4873/-/ping || exit 1" + --health-interval=10s + --health-timeout=20s + --health-retries=6 steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Node - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 - with: - node-version-file: '.nvmrc' - - name: Install pnpm - run: | - corepack enable - corepack install - - name: set store - run: | - mkdir ~/.pnpm-store - pnpm config set store-dir ~/.pnpm-store - - name: Install - run: pnpm install --registry http://localhost:4873 - - name: Cache .pnpm-store - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2 - with: - path: ~/.pnpm-store - key: pnpm-${{ hashFiles('pnpm-lock.yaml') }} - restore-keys: | - pnpm- + - name: Install dependencies with a custom registry + uses: ./.github/actions/install-app lint: runs-on: ubuntu-latest name: Lint needs: prepare steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Node - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + - name: Install dependencies with a custom registry + uses: ./.github/actions/install-app with: - node-version-file: '.nvmrc' - - name: Install pnpm - run: | - corepack enable - corepack install - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2 - with: - path: ~/.pnpm-store - key: pnpm-${{ hashFiles('pnpm-lock.yaml') }} - - name: set store - run: | - pnpm config set store-dir ~/.pnpm-store - - name: Install - run: pnpm install --ignore-scripts + reporter: 'default' - name: Lint run: pnpm lint format: @@ -83,23 +56,10 @@ jobs: needs: prepare steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Use Node - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + - name: Install dependencies with a custom registry + uses: ./.github/actions/install-app with: - node-version-file: '.nvmrc' - - name: Install pnpm - run: | - corepack enable - corepack install - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2 - with: - path: ~/.pnpm-store - key: pnpm-${{ hashFiles('pnpm-lock.yaml') }} - - name: set store - run: | - pnpm config set store-dir ~/.pnpm-store - - name: Install - run: pnpm install --ignore-scripts + reporter: 'default' - name: Lint run: pnpm format:check test: @@ -113,25 +73,10 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Use Node ${{ matrix.node_version }} - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + - name: Build application with Node ${{ matrix.node_version }} + uses: ./.github/actions/build-app with: node-version: ${{ matrix.node_version }} - - name: Install pnpm - run: | - corepack enable - corepack prepare - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2 - with: - path: ~/.pnpm-store - key: pnpm-${{ hashFiles('pnpm-lock.yaml') }} - - name: set store - run: | - pnpm config set store-dir ~/.pnpm-store - - name: Install - run: pnpm install --ignore-scripts --registry http://localhost:4873 - - name: build - run: pnpm build - name: Test run: pnpm test sync-translations: diff --git a/.github/workflows/e2e-ci.yml b/.github/workflows/e2e-ci.yml index eab74b9e0..928637c6b 100644 --- a/.github/workflows/e2e-ci.yml +++ b/.github/workflows/e2e-ci.yml @@ -19,67 +19,19 @@ jobs: NODE_ENV: production steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Use Node - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 - with: - node-version-file: '.nvmrc' - - name: Install pnpm - run: | - corepack enable - corepack prepare - - name: set store - run: | - mkdir ~/.pnpm-store - pnpm config set store-dir ~/.pnpm-store - - name: Install - run: pnpm install --reporter=silence --ignore-scripts --registry http://localhost:4873 - - name: Cache .pnpm-store - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2 - with: - path: ~/.pnpm-store - key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }} - restore-keys: | - pnpm- + - name: Install dependencies with a custom registry + uses: ./.github/actions/install-app build: needs: [prepare] runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Use Node - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + - name: Build application with Node ${{ matrix.node_version }} + uses: ./.github/actions/build-app with: - node-version-file: '.nvmrc' - - name: Install pnpm - run: | - corepack enable - corepack prepare - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2 - with: - path: ~/.pnpm-store - key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }} - - name: set store - run: | - pnpm config set store-dir ~/.pnpm-store - - name: Install - run: pnpm recursive install --reporter=silence --registry http://localhost:4873 - - name: build - run: pnpm build + node-version: ${{ matrix.node_version }} - name: Cache packages - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2 - id: cache-packages - with: - path: ./packages/ - key: pkg-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }} - restore-keys: | - packages- - # - name: Cache test - # uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # tag=v3 - # id: cache-test - # with: - # path: ./e2e/ - # key: test-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }} - # restore-keys: | - # test- + uses: ./.github/actions/cache-packages e2e-cli-npm: needs: [prepare, build] strategy: @@ -93,37 +45,19 @@ jobs: npm9, npm10 ] - node: [20, 22] + node: [18, 23] name: ${{ matrix.pkg }}/ ubuntu-latest / ${{ matrix.node }} runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + - name: Install dependencies with a custom registry version ${{ inputs.node-version }} + uses: ./.github/actions/install-app-node with: - node-version: ${{ matrix.node }} - - name: Install pnpm - run: | - corepack enable - corepack prepare - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2 - with: - path: ~/.pnpm-store - key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }} - - name: set store - run: | - pnpm config set store-dir ~/.pnpm-store - - name: Install - run: pnpm install --offline --reporter=silence --ignore-scripts --registry http://localhost:4873 - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2 - with: - path: ./packages/ - key: pkg-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }} - # - uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # tag=v3 - # with: - # path: ./e2e/ - # key: test-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }} - - name: build e2e - run: pnpm --filter @verdaccio/test-cli-commons build + node-version: ${{ inputs.node_version }} + reporter: 'default' + loglevel: 'debug' + - name: Restore cache pnpm store + uses: ./.github/actions/cache-packages - name: Test CLI run: NODE_ENV=production pnpm test --filter ...@verdaccio/e2e-cli-${{matrix.pkg}} @@ -138,37 +72,19 @@ jobs: pnpm9, pnpm10, ] - node: [20, 22] + node: [18, 23] name: ${{ matrix.pkg }}/ ubuntu-latest / ${{ matrix.node }} runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + - name: Install dependencies with a custom registry version ${{ inputs.node-version }} + uses: ./.github/actions/install-app-node with: - node-version: ${{ matrix.node }} - - name: Install pnpm - run: | - corepack enable - corepack prepare - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2 - with: - path: ~/.pnpm-store - key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }} - - name: set store - run: | - pnpm config set store-dir ~/.pnpm-store - - name: Install - run: pnpm install --loglevel debug --ignore-scripts --registry http://localhost:4873 - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2 - with: - path: ./packages/ - key: pkg-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }} - # - uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # tag=v3 - # with: - # path: ./e2e/ - # key: test-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }} - - name: build e2e - run: pnpm --filter @verdaccio/test-cli-commons build + node-version: ${{ inputs.node_version }} + reporter: 'default' + loglevel: 'debug' + - name: Restore cache pnpm store + uses: ./.github/actions/cache-packages - name: Test CLI run: NODE_ENV=production pnpm test --filter ...@verdaccio/e2e-cli-${{matrix.pkg}} e2e-cli-yarn: @@ -183,37 +99,19 @@ jobs: yarn3, yarn4 ] - node: [20, 22] + node: [18, 23] name: ${{ matrix.pkg }}/ ubuntu-latest / ${{ matrix.node }} runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + - name: Install dependencies with a custom registry version ${{ inputs.node-version }} + uses: ./.github/actions/install-app-node with: - node-version: ${{ matrix.node }} - - name: Install pnpm - run: | - corepack enable - corepack prepare - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2 - with: - path: ~/.pnpm-store - key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }} - - name: set store - run: | - pnpm config set store-dir ~/.pnpm-store - - name: Install - run: pnpm install --offline --reporter=silence --ignore-scripts --registry http://localhost:4873 - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2 - with: - path: ./packages/ - key: pkg-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }} - # - uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # tag=v3 - # with: - # path: ./e2e/ - # key: test-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }} - - name: build e2e - run: pnpm --filter @verdaccio/test-cli-commons build + node-version: ${{ inputs.node_version }} + reporter: 'default' + loglevel: 'debug' + - name: Restore cache pnpm store + uses: ./.github/actions/cache-packages - name: Test CLI run: NODE_ENV=production pnpm test --filter ...@verdaccio/e2e-cli-${{matrix.pkg}} diff --git a/.github/workflows/e2e-ui.yml b/.github/workflows/e2e-ui.yml index 248abd5c6..0541e0502 100644 --- a/.github/workflows/e2e-ui.yml +++ b/.github/workflows/e2e-ui.yml @@ -1,11 +1,12 @@ name: E2E UI on: [pull_request] + permissions: contents: read concurrency: group: e2e-ui-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: true jobs: test: runs-on: ubuntu-latest @@ -19,18 +20,10 @@ jobs: NODE_ENV: production steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Use Node - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + - name: Build application with Node 20 + uses: ./.github/actions/build-app with: - node-version-file: '.nvmrc' - - name: Install pnpm - run: | - corepack enable - corepack prepare - - name: Install - run: pnpm install --reporter=silence --registry http://localhost:4873 - - name: build - run: pnpm build + node-version: 20 - name: Test UI run: pnpm test:e2e:ui - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 diff --git a/.github/workflows/plugin-generator-e2e.yaml b/.github/workflows/plugin-generator-e2e.yaml index 1528b8fdb..a592b9d72 100644 --- a/.github/workflows/plugin-generator-e2e.yaml +++ b/.github/workflows/plugin-generator-e2e.yaml @@ -9,32 +9,20 @@ on: concurrency: group: generator-plugin-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: true jobs: e2e-plugin-generator: runs-on: ubuntu-latest strategy: matrix: - node-version: [18,20, 21] + node-version: [20, 22, 23] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + - name: Build application with Node ${{ matrix.node_version }} + uses: ./.github/actions/build-app with: - node-version: ${{ matrix.node-version }} - - name: Install pnpm - run: | - corepack enable - corepack install - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2 - with: - path: ~/.pnpm-store - key: pnpm-${{ hashFiles('pnpm-lock.yaml') }} - - name: install - run: pnpm install - - name: build - run: pnpm build + node-version: ${{ matrix.node_version }} - name: install verdaccio run: npm install -g verdaccio@5 - name: Start server @@ -49,4 +37,4 @@ jobs: run: npm install -g yo@4 --loglevel=info - name: install generator run: npm install -g generator-verdaccio-plugin --loglevel=info --registry http://localhost:4873 -# Future: add a test to verify the plugin is working with prompt +# Future: add a test to verify the plugin is working with prompt diff --git a/.github/workflows/static-data.yml b/.github/workflows/static-data.yml index c52ded043..e7f41cde8 100644 --- a/.github/workflows/static-data.yml +++ b/.github/workflows/static-data.yml @@ -3,6 +3,7 @@ name: static data on: workflow_dispatch: +# pull_request: schedule: # twice peer week - cron: '0 0 * * 1,4' @@ -24,13 +25,10 @@ jobs: with: persist-credentials: false fetch-depth: 0 - - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + - name: Install dependencies with a custom registry + uses: ./.github/actions/install-app with: - node-version: 18.x - - name: install pnpm - run: sudo npm i pnpm@latest-8 -g - - name: install dependencies - run: pnpm install + reporter: 'default' - name: Build Translations percentage run: pnpm --filter @verdaccio/crowdin-translations build - name: update contributors @@ -42,7 +40,7 @@ jobs: - name: update translations run: pnpm run translations env: - TOKEN: ${{ secrets.CROWDIN_VERDACCIO_API_KEY }} + TOKEN: ${{ secrets.CROWDIN_VERDACCIO_API_KEY }} - name: format run: pnpm format - name: Commit & Push changes diff --git a/.github/workflows/ui-components.yml b/.github/workflows/ui-components.yml index 944084937..abf9fd74c 100644 --- a/.github/workflows/ui-components.yml +++ b/.github/workflows/ui-components.yml @@ -1,9 +1,10 @@ name: UI Components on: +# pull_request: workflow_dispatch: - schedule: - - cron: '0 0 * * *' +# schedule: +# - cron: '0 0 * * *' permissions: contents: read # to fetch code (actions/checkout) @@ -25,27 +26,15 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Use Node - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 - with: - node-version-file: '.nvmrc' - - - name: Cache pnpm modules - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2 - env: - cache-name: cache-pnpm-modules - with: - path: ~/.pnpm-store - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}- + - name: Install dependencies with a custom registry + uses: ./.github/actions/install-app - name: Install pnpm run: | corepack enable - corepack prepare --activate pnpm@8.9.0 + corepack prepare - name: Install - run: pnpm install + run: pnpm install - name: Build storybook run: pnpm ui:storybook:build - name: Copy public content diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index f4b2bbf48..3d466885d 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -2,7 +2,6 @@ name: Verdaccio Website CI on: workflow_dispatch: - permissions: contents: read # to fetch code (actions/checkout) @@ -31,30 +30,10 @@ jobs: NODE_OPTIONS: --max_old_space_size=4096 steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Node - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + - name: Build application with Node 20 + uses: ./.github/actions/build-app with: - node-version-file: '.nvmrc' - - name: Install pnpm - run: | - corepack enable - corepack install - - name: set store - run: | - mkdir ~/.pnpm-store - pnpm config set store-dir ~/.pnpm-store - - name: Install - run: pnpm install --registry http://localhost:4873 - - name: Cache .pnpm-store - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2 - with: - path: ~/.pnpm-store - key: pnpm-${{ hashFiles('pnpm-lock.yaml') }} - restore-keys: | - pnpm- - - name: Build - run: pnpm build + node-version: 20 - name: Build Translations percentage run: pnpm --filter @verdaccio/crowdin-translations build - name: Cache Docusaurus Build diff --git a/e2e/ui/package.json b/e2e/ui/package.json index 31ab2ca2f..84fe9e49e 100644 --- a/e2e/ui/package.json +++ b/e2e/ui/package.json @@ -13,6 +13,7 @@ }, "scripts": { "cypress:open": "cypress open", - "test": "cypress run" + "cypress:install": "cypress install", + "test": "cypress install && cypress run" } }