2022-09-18 14:47:23 -05:00
|
|
|
name: E2E CLI
|
|
|
|
|
2022-09-24 04:30:16 -05:00
|
|
|
on: [pull_request]
|
2022-09-18 14:47:23 -05:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
jobs:
|
|
|
|
prepare:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: setup e2e verdaccio
|
|
|
|
services:
|
|
|
|
verdaccio:
|
2023-04-17 00:49:45 -05:00
|
|
|
image: verdaccio/verdaccio:nightly-master
|
2022-09-18 14:47:23 -05:00
|
|
|
ports:
|
|
|
|
- 4873:4873
|
|
|
|
env:
|
|
|
|
NODE_ENV: production
|
|
|
|
steps:
|
2023-06-11 20:36:44 -05:00
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
|
2022-09-19 16:10:38 -05:00
|
|
|
- name: Use Node
|
2023-01-18 13:35:18 -05:00
|
|
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # tag=v3
|
2022-09-18 14:47:23 -05:00
|
|
|
with:
|
2022-09-19 16:10:38 -05:00
|
|
|
node-version-file: '.nvmrc'
|
2022-09-18 14:47:23 -05:00
|
|
|
- name: Install pnpm
|
2023-04-12 01:23:01 -05:00
|
|
|
run: npm i pnpm@latest-8 -g
|
2022-09-18 14:47:23 -05:00
|
|
|
- name: set store
|
|
|
|
run: |
|
|
|
|
mkdir ~/.pnpm-store
|
|
|
|
pnpm config set store-dir ~/.pnpm-store
|
|
|
|
- name: Install
|
2023-04-12 01:23:01 -05:00
|
|
|
run: pnpm install --reporter=silence --ignore-scripts --registry http://localhost:4873
|
2022-09-18 14:47:23 -05:00
|
|
|
- name: Cache .pnpm-store
|
2023-03-16 01:31:06 -05:00
|
|
|
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
|
2022-09-18 14:47:23 -05:00
|
|
|
with:
|
|
|
|
path: ~/.pnpm-store
|
2022-09-27 15:56:17 -05:00
|
|
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
|
2022-09-18 14:47:23 -05:00
|
|
|
restore-keys: |
|
|
|
|
pnpm-
|
|
|
|
build:
|
|
|
|
needs: [prepare]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-06-11 20:36:44 -05:00
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
|
2022-09-18 14:47:23 -05:00
|
|
|
- name: Use Node 16
|
2023-01-18 13:35:18 -05:00
|
|
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # tag=v3
|
2022-09-18 14:47:23 -05:00
|
|
|
with:
|
2022-09-19 16:10:38 -05:00
|
|
|
node-version-file: '.nvmrc'
|
2022-09-18 14:47:23 -05:00
|
|
|
- name: Install pnpm
|
2023-04-12 01:23:01 -05:00
|
|
|
run: npm i pnpm@latest-8 -g
|
2023-03-16 01:31:06 -05:00
|
|
|
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
|
2022-09-18 14:47:23 -05:00
|
|
|
with:
|
|
|
|
path: ~/.pnpm-store
|
2022-09-27 15:56:17 -05:00
|
|
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
|
2023-04-12 01:23:01 -05:00
|
|
|
- name: set store
|
|
|
|
run: |
|
|
|
|
pnpm config set store-dir ~/.pnpm-store
|
2022-09-18 14:47:23 -05:00
|
|
|
- name: Install
|
2023-04-12 01:23:01 -05:00
|
|
|
run: pnpm recursive install --reporter=silence --registry http://localhost:4873
|
2022-09-18 14:47:23 -05:00
|
|
|
- name: build
|
|
|
|
run: pnpm build
|
|
|
|
- name: Cache packages
|
2023-03-16 01:31:06 -05:00
|
|
|
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
|
2022-09-18 14:47:23 -05:00
|
|
|
id: cache-packages
|
|
|
|
with:
|
|
|
|
path: ./packages/
|
2022-09-27 15:56:17 -05:00
|
|
|
key: pkg-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
|
2022-09-18 14:47:23 -05:00
|
|
|
restore-keys: |
|
|
|
|
packages-
|
2022-09-27 15:56:17 -05:00
|
|
|
# - name: Cache test
|
2022-10-18 14:35:30 -05:00
|
|
|
# uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # tag=v3
|
2022-09-27 15:56:17 -05:00
|
|
|
# id: cache-test
|
|
|
|
# with:
|
|
|
|
# path: ./e2e/
|
|
|
|
# key: test-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
|
|
|
|
# restore-keys: |
|
|
|
|
# test-
|
2022-09-18 14:47:23 -05:00
|
|
|
e2e-cli:
|
|
|
|
needs: [prepare, build]
|
|
|
|
strategy:
|
2022-09-24 06:44:34 -05:00
|
|
|
fail-fast: false
|
2022-09-18 14:47:23 -05:00
|
|
|
matrix:
|
2023-02-25 02:03:46 -05:00
|
|
|
pkg: [npm6, npm7, npm8, npm9, pnpm6, pnpm7, pnpm8, yarn1, yarn2, yarn3, yarn4]
|
2023-01-29 09:08:50 -05:00
|
|
|
node: [16, 18, 19]
|
|
|
|
name: ${{ matrix.pkg }}/ ubuntu-latest / ${{ matrix.node }}
|
2022-09-18 14:47:23 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-06-11 20:36:44 -05:00
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
|
2023-01-18 13:35:18 -05:00
|
|
|
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # tag=v3
|
2022-09-18 14:47:23 -05:00
|
|
|
with:
|
2023-01-29 09:08:50 -05:00
|
|
|
node-version: ${{ matrix.node }}
|
2022-09-18 14:47:23 -05:00
|
|
|
- name: Install pnpm
|
2023-04-12 01:23:01 -05:00
|
|
|
run: npm i pnpm@latest-8 -g
|
2023-03-16 01:31:06 -05:00
|
|
|
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
|
2022-09-18 14:47:23 -05:00
|
|
|
with:
|
|
|
|
path: ~/.pnpm-store
|
2022-09-27 15:56:17 -05:00
|
|
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
|
2023-04-12 01:23:01 -05:00
|
|
|
- name: set store
|
|
|
|
run: |
|
|
|
|
pnpm config set store-dir ~/.pnpm-store
|
2022-09-18 14:47:23 -05:00
|
|
|
- name: Install
|
2023-04-12 01:23:01 -05:00
|
|
|
run: pnpm install --offline --reporter=silence --ignore-scripts --registry http://localhost:4873
|
2023-03-16 01:31:06 -05:00
|
|
|
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
|
2022-09-18 14:47:23 -05:00
|
|
|
with:
|
|
|
|
path: ./packages/
|
2022-09-27 15:56:17 -05:00
|
|
|
key: pkg-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
|
2022-10-18 14:35:30 -05:00
|
|
|
# - uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # tag=v3
|
2022-09-27 15:56:17 -05:00
|
|
|
# with:
|
|
|
|
# path: ./e2e/
|
|
|
|
# key: test-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
|
|
|
|
- name: build e2e
|
2023-04-12 01:23:01 -05:00
|
|
|
run: pnpm --filter @verdaccio/test-cli-commons build
|
2022-09-18 14:47:23 -05:00
|
|
|
- name: Test CLI
|
|
|
|
run: NODE_ENV=production pnpm test --filter ...@verdaccio/e2e-cli-${{matrix.pkg}}
|