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:
|
|
|
|
image: verdaccio/verdaccio:nightly-master
|
|
|
|
ports:
|
|
|
|
- 4873:4873
|
|
|
|
env:
|
|
|
|
NODE_ENV: production
|
|
|
|
steps:
|
2022-12-21 15:59:21 -05:00
|
|
|
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
|
2022-09-19 16:10:38 -05:00
|
|
|
- name: Use Node
|
2022-10-18 14:36:22 -05:00
|
|
|
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # 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
|
|
|
|
run: npm i pnpm@6.32.15 -g
|
|
|
|
- name: set store
|
|
|
|
run: |
|
|
|
|
mkdir ~/.pnpm-store
|
|
|
|
pnpm config set store-dir ~/.pnpm-store
|
|
|
|
- name: Install
|
|
|
|
run: pnpm recursive install --frozen-lockfile --reporter=silence --ignore-scripts --registry http://localhost:4873
|
|
|
|
- name: Cache .pnpm-store
|
2023-01-18 13:34:56 -05:00
|
|
|
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # 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:
|
2022-12-21 15:59:21 -05:00
|
|
|
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
|
2022-09-18 14:47:23 -05:00
|
|
|
- name: Use Node 16
|
2022-10-18 14:36:22 -05:00
|
|
|
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # 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
|
|
|
|
run: npm i pnpm@6.32.15 -g
|
2023-01-18 13:34:56 -05:00
|
|
|
- uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # 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
|
|
|
- name: Install
|
2022-09-19 16:10:38 -05:00
|
|
|
run: pnpm recursive install --frozen-lockfile --reporter=silence --registry http://localhost:4873
|
2022-09-18 14:47:23 -05:00
|
|
|
- name: build
|
|
|
|
run: pnpm build
|
|
|
|
- name: Cache packages
|
2023-01-18 13:34:56 -05:00
|
|
|
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # 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:
|
2022-09-24 01:53:03 -05:00
|
|
|
pkg: [npm6, npm7, npm8, npm9, pnpm6, pnpm7, yarn1, yarn2, yarn3, yarn4]
|
2022-09-19 16:10:38 -05:00
|
|
|
name: ${{ matrix.pkg }} / ${{ matrix.os }}
|
2022-09-18 14:47:23 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-12-21 15:59:21 -05:00
|
|
|
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
|
2022-10-18 14:36:22 -05:00
|
|
|
- uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3
|
2022-09-18 14:47:23 -05:00
|
|
|
with:
|
|
|
|
node-version-file: '.nvmrc'
|
|
|
|
- name: Install pnpm
|
|
|
|
run: npm i pnpm@6.32.15 -g
|
2023-01-18 13:34:56 -05:00
|
|
|
- uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # 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
|
|
|
- name: Install
|
|
|
|
run: pnpm recursive install --offline --frozen-lockfile --reporter=silence --ignore-scripts --registry http://localhost:4873
|
2023-01-18 13:34:56 -05:00
|
|
|
- uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # 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
|
|
|
|
run: pnpm run build --filter=./e2e
|
2022-09-18 14:47:23 -05:00
|
|
|
- name: Test CLI
|
|
|
|
run: NODE_ENV=production pnpm test --filter ...@verdaccio/e2e-cli-${{matrix.pkg}}
|