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:
|
2023-01-18 14:06:56 -05:00
|
|
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag=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
|
|
|
|
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-02-28 00:31:29 -05:00
|
|
|
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # 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-01-18 14:06:56 -05:00
|
|
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag=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
|
|
|
|
run: npm i pnpm@6.32.15 -g
|
2023-02-28 00:31:29 -05:00
|
|
|
- uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # 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-02-28 00:31:29 -05:00
|
|
|
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # 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-01-18 14:06:56 -05:00
|
|
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag=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
|
|
|
|
run: npm i pnpm@6.32.15 -g
|
2023-02-28 00:31:29 -05:00
|
|
|
- uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # 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-02-28 00:31:29 -05:00
|
|
|
- uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # 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}}
|