mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-03-11 02:15:57 -05:00
build: ci better performance (#2195)
* chore: frozen installation * chore: add service disable some workflows * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: update ci * chore: add windows * chore: add e2e ui * chore: add cli * chore: add cli * chore: add website ci * chore: improve naming
This commit is contained in:
parent
648575aa41
commit
04931c968e
8 changed files with 209 additions and 189 deletions
41
.github/workflows/ci-e2e-ui.yml
vendored
41
.github/workflows/ci-e2e-ui.yml
vendored
|
@ -1,41 +0,0 @@
|
||||||
name: E2E UI
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- .github/workflows/ci.yml
|
|
||||||
- 'packages/**'
|
|
||||||
- 'jest/**'
|
|
||||||
- 'package.json'
|
|
||||||
- 'pnpm-workspace.yaml'
|
|
||||||
- 'test/**'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
ci:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
node_version: [14]
|
|
||||||
|
|
||||||
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2.3.1
|
|
||||||
- name: Use Node ${{ matrix.node_version }}
|
|
||||||
uses: actions/setup-node@v1
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node_version }}
|
|
||||||
- name: Install pnpm
|
|
||||||
run: npm i -g pnpm@latest
|
|
||||||
- name: Install
|
|
||||||
run: pnpm recursive install
|
|
||||||
- name: Clean
|
|
||||||
run: pnpm clean
|
|
||||||
- name: Build
|
|
||||||
run: pnpm build
|
|
||||||
- name: Test UI
|
|
||||||
run: pnpm test:e2e:ui
|
|
||||||
env:
|
|
||||||
DEBUG: verdaccio:e2e*
|
|
39
.github/workflows/ci-e2e.yml
vendored
39
.github/workflows/ci-e2e.yml
vendored
|
@ -1,39 +0,0 @@
|
||||||
name: E2E CLI
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- .github/workflows/ci.yml
|
|
||||||
- 'packages/**'
|
|
||||||
- 'jest/**'
|
|
||||||
- 'package.json'
|
|
||||||
- 'pnpm-workspace.yaml'
|
|
||||||
- 'test/**'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
ci:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
node_version: [14]
|
|
||||||
|
|
||||||
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2.3.1
|
|
||||||
- name: Use Node ${{ matrix.node_version }}
|
|
||||||
uses: actions/setup-node@v1
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node_version }}
|
|
||||||
- name: Install pnpm
|
|
||||||
run: npm i -g pnpm@latest
|
|
||||||
- name: Install
|
|
||||||
run: pnpm recursive install
|
|
||||||
- name: Clean
|
|
||||||
run: pnpm clean
|
|
||||||
- name: Build
|
|
||||||
run: pnpm build
|
|
||||||
- name: Test CLI
|
|
||||||
run: pnpm test:e2e:cli
|
|
40
.github/workflows/ci-website.yml
vendored
40
.github/workflows/ci-website.yml
vendored
|
@ -1,40 +0,0 @@
|
||||||
name: CI Website
|
|
||||||
|
|
||||||
on:
|
|
||||||
# disabled on master until deployment is need it
|
|
||||||
# push:
|
|
||||||
# branches:
|
|
||||||
# - master
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- .github/workflows/ci-website.yml
|
|
||||||
- 'website/**'
|
|
||||||
jobs:
|
|
||||||
ci:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest, windows-latest]
|
|
||||||
node_version: [14]
|
|
||||||
|
|
||||||
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- name: Use Node ${{ matrix.node_version }}
|
|
||||||
uses: actions/setup-node@v2
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node_version }}
|
|
||||||
- name: Install pnpm
|
|
||||||
run: curl -f https://get.pnpm.io/v6.js | node - add --global pnpm
|
|
||||||
- name: Install
|
|
||||||
run: pnpm recursive install
|
|
||||||
- name: Format
|
|
||||||
run: pnpm format:check
|
|
||||||
- name: Lint
|
|
||||||
run: pnpm lint
|
|
||||||
- name: Build website
|
|
||||||
run: |
|
|
||||||
cd website
|
|
||||||
pnpm build
|
|
218
.github/workflows/ci.yml
vendored
218
.github/workflows/ci.yml
vendored
|
@ -14,31 +14,227 @@ on:
|
||||||
- 'package.json'
|
- 'package.json'
|
||||||
- 'pnpm-workspace.yaml'
|
- 'pnpm-workspace.yaml'
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
prepare:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: setup verdaccio
|
||||||
|
services:
|
||||||
|
verdaccio:
|
||||||
|
image: verdaccio/verdaccio:5
|
||||||
|
ports:
|
||||||
|
- 4873:4873
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2.3.1
|
||||||
|
- name: Use Node 14
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 14
|
||||||
|
- name: Install pnpm
|
||||||
|
run: npm i pnpm@latest -g
|
||||||
|
- name: set store
|
||||||
|
run: |
|
||||||
|
mkdir ~/.pnpm-store
|
||||||
|
pnpm config set store-dir ~/.pnpm-store
|
||||||
|
- name: Install
|
||||||
|
run: pnpm recursive install --frozen-lockfile --registry http://localhost:4873
|
||||||
|
- name: Cache .pnpm-store
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.pnpm-store
|
||||||
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||||
|
restore-keys: |
|
||||||
|
pnpm-
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Lint
|
||||||
|
needs: prepare
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2.3.1
|
||||||
|
- name: Use Node 16
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
- name: Install pnpm
|
||||||
|
run: npm i pnpm@latest -g
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.pnpm-store
|
||||||
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||||
|
- name: Install
|
||||||
|
run: pnpm recursive install --frozen-lockfile --ignore-scripts
|
||||||
|
- name: Lint
|
||||||
|
run: pnpm lint
|
||||||
|
format:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Format
|
||||||
|
needs: prepare
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2.3.1
|
||||||
|
- name: Use Node 16
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
- name: Install pnpm
|
||||||
|
run: npm i pnpm@latest -g
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.pnpm-store
|
||||||
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||||
|
- name: Install
|
||||||
|
run: pnpm recursive install --frozen-lockfile --ignore-scripts
|
||||||
|
- name: Lint
|
||||||
|
run: pnpm format:check
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: build
|
||||||
|
needs: [format, lint]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2.3.1
|
||||||
|
- name: Use Node 16
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
- name: Install pnpm
|
||||||
|
run: npm i pnpm@latest -g
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.pnpm-store
|
||||||
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||||
|
- name: Install
|
||||||
|
## we run scripts due gatsby needs it
|
||||||
|
## when website is excluded we can add --ignore-scripts
|
||||||
|
run: pnpm recursive install --frozen-lockfile --ignore-scripts
|
||||||
|
- name: build
|
||||||
|
run: pnpm build
|
||||||
|
- name: tar packages
|
||||||
|
run: |
|
||||||
|
tar -czvf ${{ github.workspace }}/pkg.tar.gz -C ${{ github.workspace }}/packages .
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: verdaccio-artifact
|
||||||
|
path: pkg.tar.gz
|
||||||
|
test:
|
||||||
|
needs: build
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: true
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest]
|
os: [ubuntu-latest]
|
||||||
node_version: [12, 14]
|
node_version: [12, 14]
|
||||||
|
|
||||||
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.1
|
- uses: actions/checkout@v2.3.1
|
||||||
- name: Use Node ${{ matrix.node_version }}
|
- name: Use Node ${{ matrix.node_version }}
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node_version }}
|
node-version: ${{ matrix.node_version }}
|
||||||
|
- uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: verdaccio-artifact
|
||||||
|
- name: untar packages
|
||||||
|
run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
run: npm i pnpm@latest -g
|
run: npm i pnpm@latest -g
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.pnpm-store
|
||||||
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||||
- name: Install
|
- name: Install
|
||||||
run: pnpm recursive install
|
run: pnpm recursive install --frozen-lockfile --ignore-scripts
|
||||||
- name: Lint
|
- name: Test
|
||||||
run: pnpm lint
|
run: pnpm test
|
||||||
- name: Clean
|
ci-e2e-ui:
|
||||||
run: pnpm clean
|
needs: build
|
||||||
- name: Build
|
runs-on: ubuntu-latest
|
||||||
|
name: UI Test E2E Node 14
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2.3.1
|
||||||
|
- uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 14
|
||||||
|
- uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: verdaccio-artifact
|
||||||
|
- name: untar packages
|
||||||
|
run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages
|
||||||
|
- name: Install pnpm
|
||||||
|
run: npm i pnpm@latest -g
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.pnpm-store
|
||||||
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||||
|
- name: Install
|
||||||
|
## we need scripts, pupetter downloads aditional content
|
||||||
|
run: pnpm recursive install --frozen-lockfile
|
||||||
|
- name: Test UI
|
||||||
|
run: pnpm test:e2e:ui
|
||||||
|
env:
|
||||||
|
DEBUG: verdaccio:e2e*
|
||||||
|
ci-e2e-cli:
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: CLI Test E2E Node 14
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2.3.1
|
||||||
|
- uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 14
|
||||||
|
- uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: verdaccio-artifact
|
||||||
|
- name: untar packages
|
||||||
|
run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages
|
||||||
|
- name: Install pnpm
|
||||||
|
run: npm i pnpm@latest -g
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.pnpm-store
|
||||||
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||||
|
- name: Install
|
||||||
|
## we need scripts, pupetter downloads aditional content
|
||||||
|
run: pnpm recursive install --frozen-lockfile
|
||||||
|
- name: Test CLI
|
||||||
|
run: pnpm test:e2e:cli
|
||||||
|
website:
|
||||||
|
needs: [format, lint]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: website build node 14
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2.3.1
|
||||||
|
- uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 14
|
||||||
|
- name: Install pnpm
|
||||||
|
run: npm i pnpm@latest -g
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.pnpm-store
|
||||||
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||||
|
- name: Install
|
||||||
|
run: pnpm recursive install --frozen-lockfile
|
||||||
|
- name: Build website
|
||||||
|
run: |
|
||||||
|
cd website
|
||||||
|
pnpm build:website
|
||||||
|
test-windows:
|
||||||
|
needs: [format, lint]
|
||||||
|
runs-on: windows-latest
|
||||||
|
name: windows test node 14
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2.3.1
|
||||||
|
- name: Use Node 14
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 14
|
||||||
|
- name: Install pnpm
|
||||||
|
run: npm i pnpm@latest -g
|
||||||
|
# pnpm cache is not working for windows (we need a solution)
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.pnpm-store
|
||||||
|
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||||
|
- name: Install
|
||||||
|
run: pnpm recursive install --frozen-lockfile --ignore-scripts
|
||||||
|
- name: build
|
||||||
run: pnpm build
|
run: pnpm build
|
||||||
- name: Test
|
- name: Test
|
||||||
run: pnpm test
|
run: pnpm test
|
||||||
|
|
30
.github/workflows/docker-publish-pre-check.yml
vendored
30
.github/workflows/docker-publish-pre-check.yml
vendored
|
@ -1,30 +0,0 @@
|
||||||
name: Docker & Publish Pre-check
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- .github/workflows/docker-publish-pre-check.yml
|
|
||||||
- 'packages/**'
|
|
||||||
- 'docker-bin/**'
|
|
||||||
- 'package.json'
|
|
||||||
- 'lerna.json'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
testDocker:
|
|
||||||
name: Test Docker Build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2.3.1
|
|
||||||
- name: Build
|
|
||||||
run: npm run docker
|
|
||||||
env:
|
|
||||||
VERDACCIO_BUILD_REGISTRY: https://registry.verdaccio.org
|
|
||||||
# testVerdaccio:
|
|
||||||
# name: Test Verdaccio Publish
|
|
||||||
# runs-on: ubuntu-latest
|
|
||||||
# steps:
|
|
||||||
# - uses: actions/checkout@v1
|
|
||||||
# - name: Publish
|
|
||||||
# uses: verdaccio/github-actions/publish@v0.4.0
|
|
||||||
# with:
|
|
||||||
# args: -d
|
|
26
.github/workflows/format.yml
vendored
26
.github/workflows/format.yml
vendored
|
@ -1,26 +0,0 @@
|
||||||
name: format
|
|
||||||
|
|
||||||
on: [pull_request]
|
|
||||||
jobs:
|
|
||||||
format:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
node_version: [16]
|
|
||||||
|
|
||||||
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2.3.1
|
|
||||||
- name: Use Node ${{ matrix.node_version }}
|
|
||||||
uses: actions/setup-node@v1
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node_version }}
|
|
||||||
- name: Install pnpm
|
|
||||||
run: npm i pnpm@latest -g
|
|
||||||
- name: Install
|
|
||||||
run: pnpm recursive install
|
|
||||||
- name: Format
|
|
||||||
run: pnpm format:check
|
|
|
@ -17,7 +17,7 @@
|
||||||
"clean": "rimraf ./dist",
|
"clean": "rimraf ./dist",
|
||||||
"lint": "eslint . --ext .js,.ts",
|
"lint": "eslint . --ext .js,.ts",
|
||||||
"build:web": "ts-node ./scripts/web.ts",
|
"build:web": "ts-node ./scripts/web.ts",
|
||||||
"build": "pnpm run clean && webpack --progress && pnpm run build:web",
|
"build:standalone": "pnpm run clean && webpack --progress && pnpm run build:web",
|
||||||
"build:stats": "webpack --json > stats.json",
|
"build:stats": "webpack --json > stats.json",
|
||||||
"build:size": "webpack --json | webpack-bundle-size-analyzer"
|
"build:size": "webpack --json | webpack-bundle-size-analyzer"
|
||||||
},
|
},
|
||||||
|
|
|
@ -71,7 +71,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lisan:compile": "lisan compile",
|
"lisan:compile": "lisan compile",
|
||||||
"build": "gatsby build",
|
"build:website": "gatsby build",
|
||||||
"clean": "gatsby clean",
|
"clean": "gatsby clean",
|
||||||
"serve": "gatsby serve",
|
"serve": "gatsby serve",
|
||||||
"develop": "gatsby develop",
|
"develop": "gatsby develop",
|
||||||
|
|
Loading…
Add table
Reference in a new issue