From 5e28d40f77cbeeddf045a5f2f57c5423e9d35f7c Mon Sep 17 00:00:00 2001 From: Abraham Schilling Date: Tue, 1 Sep 2020 21:22:36 +0200 Subject: [PATCH] build: add missing os matrix (#1928) --- .editorconfig | 3 +- .github/disabled/e2e-angular-cli-workflow.yml | 144 +++++++--------- .../disabled/e2e-gatsbyjs-cli-workflow.yml | 7 +- .github/disabled/e2e-jest-workflow.yml | 158 ++++-------------- .github/disabled/registry.yml | 6 +- .github/disabled/release-canary.yml | 42 ++--- .github/workflows/changesets.yml | 3 +- .github/workflows/ci-website.yml | 5 +- .github/workflows/ci.yml | 13 +- .github/workflows/codeql-analysis.yml | 62 ++++--- .../workflows/docker-publish-pre-check.yml | 30 ++-- .github/workflows/docker-publish.yml | 21 ++- 12 files changed, 192 insertions(+), 302 deletions(-) diff --git a/.editorconfig b/.editorconfig index 42bfe7af3..86af2bc00 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,6 +7,7 @@ end_of_line = lf insert_final_newline = true # 2 space indentation -[{.,}*.{js,jsx,yml,yaml}] +[{.,}*.{ts,tsx,js,jsx,yml,yaml}] indent_style = space indent_size = 2 +quote_type = single diff --git a/.github/disabled/e2e-angular-cli-workflow.yml b/.github/disabled/e2e-angular-cli-workflow.yml index 2b3eae44e..a113661f9 100644 --- a/.github/disabled/e2e-angular-cli-workflow.yml +++ b/.github/disabled/e2e-angular-cli-workflow.yml @@ -1,64 +1,74 @@ on: schedule: - - cron: '0 3 * * 5' + - cron: '0 3 * * 5' pull_request: branches: - - '**' + - '**' name: 'E2E Angular CLI with verdaccio' jobs: -# todo: fix yarn global issue, cannot find ng -# yarn: -# name: 'yarn:angular example' -# runs-on: ${{ matrix.os }} -# -# steps: -# - uses: actions/checkout@v2.3.3 -# -# - name: 'Use Node.js 10.x' -# uses: actions/setup-node@v2.1.5 -# with: -# node-version: 10.x -# - name: Install Dependencies -# run: yarn install --pure-lockfile -# - name: 'Run verdaccio in the background' -# run: | -# nohup node ./scripts/run-verdaccio.js & -# - name: 'Ping to verdaccio' -# run: | -# npm ping --registry http://localhost:4873 -# - name: 'Running the integration test' -# run: | -# source scripts/e2e-setup-ci.sh -# yarn init --yes -# -# yarn global add @angular/cli -# which nodemon -# ng new verdaccio-angular --interactive=false -# -# cd verdaccio-angular -# echo "registry=http://localhost:4873" > ~/.npmrc -# yarn add @angular-devkit/core@next @babel/preset-env @babel/core -D -# -# ng build --aot + # todo: fix yarn global issue, cannot find ng + # yarn: + # strategy: + # fail-fast: false + # matrix: + # os: [ubuntu-latest, windows-latest] + # + # name: '${{ matrix.os }} / yarn:angular example' + # runs-on: ${{ matrix.os }} + # + # steps: + # - uses: actions/checkout@v2.3.1 + # + # - name: 'Use Node.js 10.x' + # uses: actions/setup-node@v2.1.1 + # with: + # node-version: 10.x + # - name: Install Dependencies + # run: yarn install --pure-lockfile + # - name: 'Run verdaccio in the background' + # run: | + # nohup node ./scripts/run-verdaccio.js & + # - name: 'Ping to verdaccio' + # run: | + # npm ping --registry http://localhost:4873 + # - name: 'Running the integration test' + # run: | + # source scripts/e2e-setup-ci.sh + # yarn init --yes + # + # yarn global add @angular/cli + # which nodemon + # ng new verdaccio-angular --interactive=false + # + # cd verdaccio-angular + # echo "registry=http://localhost:4873" > ~/.npmrc + # yarn add @angular-devkit/core@next @babel/preset-env @babel/core -D + # + # ng build --aot npm: - name: 'npm:angular example' + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + + name: '${{ matrix.os }} / npm:angular example' runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2.3.3 + - uses: actions/checkout@v2.3.1 - - name: 'Use Node.js 14.x' - uses: actions/setup-node@v2.1.5 + - name: 'Use Node.js 10.x' + uses: actions/setup-node@v2.1.1 with: - node-version: 14.x + node-version: 10.x - name: 'install latest npm' - run: npm i -g npm@latest-6 + run: npm i -g npm - name: Install Dependencies - run: yarn install + run: yarn install --pure-lockfile - name: 'Run verdaccio in the background' run: | - nohup node ./scripts/run-verdaccio.js --config ./scripts/e2e-config.yaml & + nohup node ./scripts/run-verdaccio.js & - name: 'Ping to verdaccio' run: | npm ping --registry http://localhost:4873 @@ -77,52 +87,20 @@ jobs: cd verdaccio-angular npm install @angular-devkit/core@next @babel/preset-env @babel/core -D - npm run ng build --aot - npm7: - name: 'npm7:angular example' - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2.3.3 - - - name: 'Use Node.js 14.x' - uses: actions/setup-node@v2.1.5 - with: - node-version: 14.x - - name: 'install latest npm' - run: npm i -g npm@next-7 - - name: Install Dependencies - run: yarn install - - name: 'Run verdaccio in the background' - run: | - nohup node ./scripts/run-verdaccio.js --config ./scripts/e2e-config.yaml & - - name: 'Ping to verdaccio' - run: | - npm ping --registry http://localhost:4873 - - name: 'Running the integration test' - run: | - source scripts/e2e-setup-ci.sh - echo "registry=http://localhost:4873" > ~/.npmrc - npm config set loglevel="silent" - npm config set fetch-retries="5" - npm config set fetch-retry-factor="50" - npm config set fetch-retry-mintimeout="20000" - npm config set fetch-retry-maxtimeout="80000" - npm install -g @angular/cli - ng new verdaccio-angular --interactive=false - - cd verdaccio-angular - npm install @angular-devkit/core@next @babel/preset-env @babel/core -D - npm run ng build --aot # pnpm throws errors worth to check why # pnpm: -# name: 'pnpm:angular example' +# strategy: +# fail-fast: false +# matrix: +# os: [ubuntu-latest, windows-latest] +# +# name: '${{ matrix.os }} / pnpm:angular example' # runs-on: ${{ matrix.os }} # # steps: -# - uses: actions/checkout@v2.3.3 +# - uses: actions/checkout@v2.3.1 # # - name: 'Use Node.js 10.x' # uses: actions/setup-node@v2.1.1 diff --git a/.github/disabled/e2e-gatsbyjs-cli-workflow.yml b/.github/disabled/e2e-gatsbyjs-cli-workflow.yml index be08c8884..531512500 100644 --- a/.github/disabled/e2e-gatsbyjs-cli-workflow.yml +++ b/.github/disabled/e2e-gatsbyjs-cli-workflow.yml @@ -8,7 +8,12 @@ on: name: 'E2E Gatsby.js CLI with verdaccio' jobs: npm: - name: 'npm:gatsby example' + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + + name: '${{ matrix.os }} / npm:gatsby example' runs-on: ${{ matrix.os }} steps: diff --git a/.github/disabled/e2e-jest-workflow.yml b/.github/disabled/e2e-jest-workflow.yml index 559befde8..9846e2151 100644 --- a/.github/disabled/e2e-jest-workflow.yml +++ b/.github/disabled/e2e-jest-workflow.yml @@ -8,21 +8,26 @@ on: name: 'E2E Jest with verdaccio' jobs: yarn: - name: 'yarn:jest example' + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + + name: '${{ matrix.os }} / yarn:jest example' runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2.3.3 + - uses: actions/checkout@v2.3.1 - - name: 'Use Node.js 12.x' - uses: actions/setup-node@v2.1.5 + - name: 'Use Node.js 10.x' + uses: actions/setup-node@v2.1.1 with: - node-version: 12.x + node-version: 10.x - name: Install Dependencies - run: yarn install + run: yarn install --pure-lockfile - name: 'Run verdaccio in the background' run: | - nohup node ./scripts/run-verdaccio.js --config ./scripts/e2e-config.yaml & + nohup node ./scripts/run-verdaccio.js & - name: 'Ping to verdaccio' run: | npm ping --registry http://localhost:4873 @@ -38,91 +43,29 @@ jobs: yarn add left-pad --registry http://localhost:4873 --verbose echo "const leftPad = require('left-pad'); it('should resolve a module', () => { expect(typeof leftPad).toBe('function');});" | tee module.test.js yarn jest module.test.js - yarn2: - name: 'yarn2:jest example' - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2.3.3 - - - name: 'Use Node.js 12.x' - uses: actions/setup-node@v2.1.5 - with: - node-version: 12.x - - name: Install Dependencies - run: yarn install - - name: 'Run verdaccio in the background' - run: | - nohup node ./scripts/run-verdaccio.js --config ./scripts/e2e-config.yaml & - - name: 'Ping to verdaccio' - run: | - npm ping --registry http://localhost:4873 - - name: 'Running the integration test' - run: | - source scripts/e2e-setup-ci.sh - yarn init --yes - yarn set version berry - yarn config set npmRegistryServer "http://localhost:4873" - yarn config set unsafeHttpWhitelist --json '["localhost"]' - yarn add jest@26.0.0 - - echo "it('should pass', () => { expect(true).toBeTruthy(); });" | tee pass.test.js - yarn jest pass.test.js - - yarn add left-pad - echo "const leftPad = require('left-pad'); it('should resolve a module', () => { expect(typeof leftPad).toBe('function');});" | tee module.test.js - yarn jest module.test.js npm: - name: 'npm:jest example' + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + + name: '${{ matrix.os }} / npm:jest example' runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2.3.3 + - uses: actions/checkout@v2.3.1 - - name: 'Use Node.js 12.x' - uses: actions/setup-node@v2.1.5 + - name: 'Use Node.js 10.x' + uses: actions/setup-node@v2.1.1 with: - node-version: 12.x - - name: 'install latest npm' - run: npm i -g npm@latest-6 - - name: Install Dependencies - run: yarn install - - name: 'Run verdaccio in the background' - run: | - nohup node ./scripts/run-verdaccio.js --config ./scripts/e2e-config.yaml & - - name: 'Ping to verdaccio' - run: | - npm ping --registry http://localhost:4873 - - name: 'Running the integration test' - run: | - source scripts/e2e-setup-ci.sh - npm init --force - npm install jest --registry http://localhost:4873 - - echo "it('should pass', () => { expect(true).toBeTruthy(); });" | tee pass.test.js - yarn jest pass.test.js - - yarn add left-pad --registry http://localhost:4873 --verbose - echo "const leftPad = require('left-pad'); it('should resolve a module', () => { expect(typeof leftPad).toBe('function');});" | tee module.test.js - yarn jest module.test.js - npm7: - name: 'npm7:jest example' - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2.3.3 - - - name: 'Use Node.js 12.x' - uses: actions/setup-node@v2.1.5 - with: - node-version: 12.x + node-version: 10.x - name: 'install latest npm' run: npm i -g npm - name: Install Dependencies - run: yarn install + run: yarn install --pure-lockfile - name: 'Run verdaccio in the background' run: | - nohup node ./scripts/run-verdaccio.js --config ./scripts/e2e-config.yaml & + nohup node ./scripts/run-verdaccio.js & - name: 'Ping to verdaccio' run: | npm ping --registry http://localhost:4873 @@ -138,22 +81,26 @@ jobs: yarn add left-pad --registry http://localhost:4873 --verbose echo "const leftPad = require('left-pad'); it('should resolve a module', () => { expect(typeof leftPad).toBe('function');});" | tee module.test.js yarn jest module.test.js - pnpm: - name: 'pnpm:jest example' + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + + name: '${{ matrix.os }} / pnpm:jest example' runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2.3.3 + - uses: actions/checkout@v2.3.1 - - name: 'Use Node.js 12.x' - uses: actions/setup-node@v2.1.5 + - name: 'Use Node.js 10.x' + uses: actions/setup-node@v2.1.1 with: - node-version: 12.x + node-version: 10.x - name: 'install latest pnpm' run: npm i -g pnpm - name: Install Dependencies - run: yarn install + run: yarn install --pure-lockfile - name: 'Run verdaccio in the background' run: | nohup node ./scripts/run-verdaccio.js & @@ -172,38 +119,3 @@ jobs: yarn add left-pad --registry http://localhost:4873 --verbose echo "const leftPad = require('left-pad'); it('should resolve a module', () => { expect(typeof leftPad).toBe('function');});" | tee module.test.js yarn jest module.test.js - pnpm6: - name: 'pnpm6:jest example' - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2.3.3 - - - name: 'Use Node.js 12.x' - uses: actions/setup-node@v2.1.5 - with: - node-version: 12.x - - name: 'install latest pnpm' - run: sudo npm i pnpm@dev -g - - name: Install Dependencies - run: yarn install - - name: 'Run verdaccio in the background' - run: | - nohup node ./scripts/run-verdaccio.js & - - name: 'Ping to verdaccio' - run: | - pnpm ping --registry http://localhost:4873 - - name: 'Running the integration test' - run: | - source scripts/e2e-setup-ci.sh - pnpm init --force - pnpm install jest --registry http://localhost:4873 - - echo "it('should pass', () => { expect(true).toBeTruthy(); });" | tee pass.test.js - yarn jest pass.test.js - - yarn add left-pad --registry http://localhost:4873 --verbose - echo "const leftPad = require('left-pad'); it('should resolve a module', () => { expect(typeof leftPad).toBe('function');});" | tee module.test.js - yarn jest module.test.js - - diff --git a/.github/disabled/registry.yml b/.github/disabled/registry.yml index 2c875177b..7438d17bc 100644 --- a/.github/disabled/registry.yml +++ b/.github/disabled/registry.yml @@ -2,12 +2,12 @@ name: Test local registry for js vulnerabilities on: schedule: - - cron: '0 4 * * 4' + - cron: '0 4 * * 4' jobs: security: - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - name: Test for public javascript library vulnerabilities uses: lirantal/is-website-vulnerable@1.15.10 with: - scan-url: "https://registry.verdaccio.org" + scan-url: 'https://registry.verdaccio.org' diff --git a/.github/disabled/release-canary.yml b/.github/disabled/release-canary.yml index 4200090c9..0e7e41834 100644 --- a/.github/disabled/release-canary.yml +++ b/.github/disabled/release-canary.yml @@ -11,25 +11,25 @@ on: jobs: release: name: Release - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - name: Use Node (latest) - uses: actions/setup-node@v1 - with: - node_version: 13 - - name: Install - run: yarn --frozen-lockfile - - name: Clean - run: yarn clean - - name: Lint - run: yarn lint - - name: Build - run: yarn build - - name: Test - run: yarn test - - name: Publish - run: | - echo "//registry.verdaccio.org/:_authToken=${{ secrets.VERDACCIO_TOKEN }}" > .npmrc - git update-index --assume-unchanged .npmrc - yarn publish:canary + - uses: actions/checkout@v1 + - name: Use Node (latest) + uses: actions/setup-node@v1 + with: + node_version: 13 + - name: Install + run: yarn --frozen-lockfile + - name: Clean + run: yarn clean + - name: Lint + run: yarn lint + - name: Build + run: yarn build + - name: Test + run: yarn test + - name: Publish + run: | + echo "//registry.verdaccio.org/:_authToken=${{ secrets.VERDACCIO_TOKEN }}" > .npmrc + git update-index --assume-unchanged .npmrc + yarn publish:canary diff --git a/.github/workflows/changesets.yml b/.github/workflows/changesets.yml index ab283ee2a..4adaafc3c 100644 --- a/.github/workflows/changesets.yml +++ b/.github/workflows/changesets.yml @@ -1,4 +1,3 @@ - name: Changesets on: @@ -20,7 +19,7 @@ jobs: # Update package versions from changesets. version: timeout-minutes: 15 - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest if: github.ref == 'refs/heads/5.x' && github.repository == 'verdaccio/verdaccio' steps: - name: checkout code repository diff --git a/.github/workflows/ci-website.yml b/.github/workflows/ci-website.yml index 009566a82..c8a5378d5 100644 --- a/.github/workflows/ci-website.yml +++ b/.github/workflows/ci-website.yml @@ -7,17 +7,16 @@ on: pull_request: paths: - .github/workflows/ci-website.yml - - "website/**" + - 'website/**' jobs: ci: - name: ${{ matrix.os }} / Node ${{ matrix.node_version }} - 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: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e946de0f..a0556fc79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,25 +4,24 @@ on: push: branches: - 5.x - - "changeset-release/5.x" + - 'changeset-release/5.x' pull_request: paths: - .github/workflows/ci.yml - - "packages/**" - - "jest/**" - - "package.json" - - "pnpm-workspace.yaml" + - 'packages/**' + - 'jest/**' + - 'package.json' + - 'pnpm-workspace.yaml' jobs: ci: - name: ${{ matrix.os }} / Node ${{ matrix.node_version }} - strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] node_version: [10, 12, 14] + name: ${{ matrix.os }} / Node ${{ matrix.node_version }} runs-on: ${{ matrix.os }} steps: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ad890a981..77629d9f2 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,4 +1,4 @@ -name: "Code scanning - action" +name: 'Code scanning - action' on: push: @@ -11,45 +11,43 @@ on: jobs: CodeQL-Build: - - # CodeQL runs on ubuntu-latest and windows-latest - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v2.3.3 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 + - name: Checkout repository + uses: actions/checkout@v2.3.1 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 # Override language selection by uncommenting this and choosing your languages # with: # languages: go, javascript, csharp, python, cpp, java + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl + # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language + #- run: | + # make bootstrap + # make release - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/docker-publish-pre-check.yml b/.github/workflows/docker-publish-pre-check.yml index 0bb8754a9..69b405769 100644 --- a/.github/workflows/docker-publish-pre-check.yml +++ b/.github/workflows/docker-publish-pre-check.yml @@ -12,20 +12,20 @@ on: jobs: testDocker: name: Test Docker Build - runs-on: ${{ matrix.os }} + 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 + - 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: ${{ matrix.os }} -# steps: -# - uses: actions/checkout@v1 -# - name: Publish -# uses: verdaccio/github-actions/publish@v0.4.0 -# with: -# args: -d +# 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/docker-publish.yml b/.github/workflows/docker-publish.yml index 06fe0c3af..cc6367324 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -14,15 +14,14 @@ on: jobs: testDocker: name: Test Docker Build - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - name: Publish to GitHub Registry - uses: elgohr/Publish-Docker-Github-Action@master - with: - name: docker.pkg.github.com/verdaccio/verdaccio/verdaccio - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.GITHUB_REGISTRY_TOKEN}} - registry: docker.pkg.github.com - tags: "5.x" - + - uses: actions/checkout@v1 + - name: Publish to GitHub Registry + uses: elgohr/Publish-Docker-Github-Action@master + with: + name: docker.pkg.github.com/verdaccio/verdaccio/verdaccio + username: ${{secrets.DOCKER_USERNAME}} + password: ${{secrets.GITHUB_REGISTRY_TOKEN}} + registry: docker.pkg.github.com + tags: '5.x'