diff --git a/.github/workflows/ci-e2e-ui.yml b/.github/workflows/ci-e2e-ui.yml deleted file mode 100644 index 7e49352c1..000000000 --- a/.github/workflows/ci-e2e-ui.yml +++ /dev/null @@ -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* diff --git a/.github/workflows/ci-e2e.yml b/.github/workflows/ci-e2e.yml deleted file mode 100644 index 447d58e26..000000000 --- a/.github/workflows/ci-e2e.yml +++ /dev/null @@ -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 diff --git a/.github/workflows/ci-website.yml b/.github/workflows/ci-website.yml deleted file mode 100644 index e34b78e39..000000000 --- a/.github/workflows/ci-website.yml +++ /dev/null @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b973ccbfc..91c4d2751 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,31 +14,227 @@ on: - 'package.json' - 'pnpm-workspace.yaml' 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: - fail-fast: false + fail-fast: true matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest] node_version: [12, 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 }} + - 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 - run: pnpm recursive install - - name: Lint - run: pnpm lint - - name: Clean - run: pnpm clean - - name: Build + run: pnpm recursive install --frozen-lockfile --ignore-scripts + - name: Test + run: pnpm test + ci-e2e-ui: + needs: 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 - name: Test run: pnpm test diff --git a/.github/workflows/docker-publish-pre-check.yml b/.github/workflows/docker-publish-pre-check.yml deleted file mode 100644 index 5ea637e4a..000000000 --- a/.github/workflows/docker-publish-pre-check.yml +++ /dev/null @@ -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 diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml deleted file mode 100644 index 6e90e9b31..000000000 --- a/.github/workflows/format.yml +++ /dev/null @@ -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 diff --git a/packages/standalone/package.json b/packages/standalone/package.json index 18c85647c..1f76557f6 100644 --- a/packages/standalone/package.json +++ b/packages/standalone/package.json @@ -17,7 +17,7 @@ "clean": "rimraf ./dist", "lint": "eslint . --ext .js,.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:size": "webpack --json | webpack-bundle-size-analyzer" }, diff --git a/website/package.json b/website/package.json index fe977a4fc..d152917a0 100644 --- a/website/package.json +++ b/website/package.json @@ -71,7 +71,7 @@ "license": "MIT", "scripts": { "lisan:compile": "lisan compile", - "build": "gatsby build", + "build:website": "gatsby build", "clean": "gatsby clean", "serve": "gatsby serve", "develop": "gatsby develop",