From 3e13186a7c4b2a0437f1bbdf40454b12a6981854 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 13 Apr 2021 13:49:34 +0200 Subject: [PATCH 01/20] Start moving towards Github actions only --- .github/workflows/tests.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000000..4ef58f54cd8 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,29 @@ +name: Create REPL build + +on: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + name: Upload REPL build (Linux) + steps: + - name: Checkout Commit + uses: actions/checkout@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: 14 + - name: Install dependencies + run: npm ci --ignore-scripts + - name: Upload file to bucket + uses: zdurham/s3-upload-github-action@master + with: + args: --acl public-read + env: + FILE: ./dist/rollup.browser.js + AWS_REGION: us-east-1 + S3_BUCKET: rollup-ci-artefacts + S3_KEY: /${{ github.event.number }}/rollup.browser.js + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} From b87b1e36bd173ee01fc8b729e1400841f6647b69 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 13 Apr 2021 13:54:41 +0200 Subject: [PATCH 02/20] Start moving towards Github actions only --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4ef58f54cd8..74113c55b84 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,12 +16,14 @@ jobs: node-version: 14 - name: Install dependencies run: npm ci --ignore-scripts + - name: List + run: ls - name: Upload file to bucket uses: zdurham/s3-upload-github-action@master with: args: --acl public-read env: - FILE: ./dist/rollup.browser.js + FILE: dist/rollup.browser.js AWS_REGION: us-east-1 S3_BUCKET: rollup-ci-artefacts S3_KEY: /${{ github.event.number }}/rollup.browser.js From 6f96df62208d9d02ec4189a53aa4bc5d8499d175 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 13 Apr 2021 14:01:58 +0200 Subject: [PATCH 03/20] Add build step --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 74113c55b84..d893096ddd8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,6 +16,8 @@ jobs: node-version: 14 - name: Install dependencies run: npm ci --ignore-scripts + - name: Build artefacts + run: npm run build:cjs && npm run build:bootstrap - name: List run: ls - name: Upload file to bucket @@ -26,6 +28,6 @@ jobs: FILE: dist/rollup.browser.js AWS_REGION: us-east-1 S3_BUCKET: rollup-ci-artefacts - S3_KEY: /${{ github.event.number }}/rollup.browser.js + S3_KEY: ${{ github.event.number }}/rollup.browser.js AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} From cb2f536a82ed920d81abef6b651418844d257708 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 13 Apr 2021 14:13:49 +0200 Subject: [PATCH 04/20] Change bucket name --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d893096ddd8..58cd5e86aaa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +27,7 @@ jobs: env: FILE: dist/rollup.browser.js AWS_REGION: us-east-1 - S3_BUCKET: rollup-ci-artefacts + S3_BUCKET: arn:aws:s3:::rollup-ci-artefacts S3_KEY: ${{ github.event.number }}/rollup.browser.js AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} From cfbb9c7f90978e9df5a3fc16ca03d65f2d115285 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 13 Apr 2021 14:21:57 +0200 Subject: [PATCH 05/20] Change bucket name --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 58cd5e86aaa..d893096ddd8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +27,7 @@ jobs: env: FILE: dist/rollup.browser.js AWS_REGION: us-east-1 - S3_BUCKET: arn:aws:s3:::rollup-ci-artefacts + S3_BUCKET: rollup-ci-artefacts S3_KEY: ${{ github.event.number }}/rollup.browser.js AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} From cf7153314abb107de454a6674180321c7de2f80c Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 13 Apr 2021 14:28:56 +0200 Subject: [PATCH 06/20] Improve Action --- .github/workflows/tests.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d893096ddd8..6d5011db0eb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,10 +18,8 @@ jobs: run: npm ci --ignore-scripts - name: Build artefacts run: npm run build:cjs && npm run build:bootstrap - - name: List - run: ls - name: Upload file to bucket - uses: zdurham/s3-upload-github-action@master + uses: zdurham/s3-upload-github-action@1.0.1 with: args: --acl public-read env: From d8a734d1a32f76af360b6adacc6c09b6cb418f3e Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 13 Apr 2021 14:31:41 +0200 Subject: [PATCH 07/20] Improve Action --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6d5011db0eb..51014fc63a0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,7 +18,7 @@ jobs: run: npm ci --ignore-scripts - name: Build artefacts run: npm run build:cjs && npm run build:bootstrap - - name: Upload file to bucket + - name: Upload ${{ github.event.number }}/rollup.browser.js to bucket uses: zdurham/s3-upload-github-action@1.0.1 with: args: --acl public-read From a1fd479a33603a0457dd77a25b8d1e4f4f21c768 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 13 Apr 2021 14:35:00 +0200 Subject: [PATCH 08/20] Improve Action --- .github/workflows/{tests.yml => repl-artefacts.yml} | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) rename .github/workflows/{tests.yml => repl-artefacts.yml} (93%) diff --git a/.github/workflows/tests.yml b/.github/workflows/repl-artefacts.yml similarity index 93% rename from .github/workflows/tests.yml rename to .github/workflows/repl-artefacts.yml index 51014fc63a0..2145396978a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/repl-artefacts.yml @@ -1,12 +1,11 @@ -name: Create REPL build - +name: Upload on: pull_request: jobs: build: runs-on: ubuntu-latest - name: Upload REPL build (Linux) + name: REPL build steps: - name: Checkout Commit uses: actions/checkout@v2 From b90bdfa32ced907f1e9e556f2fbf5af39f715114 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 13 Apr 2021 14:37:29 +0200 Subject: [PATCH 09/20] Improve Action --- .github/workflows/repl-artefacts.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/repl-artefacts.yml b/.github/workflows/repl-artefacts.yml index 2145396978a..c9df7b6bf1b 100644 --- a/.github/workflows/repl-artefacts.yml +++ b/.github/workflows/repl-artefacts.yml @@ -1,11 +1,11 @@ -name: Upload +name: Upload REPL artefacts on: pull_request: jobs: - build: + upload: runs-on: ubuntu-latest - name: REPL build + name: Upload steps: - name: Checkout Commit uses: actions/checkout@v2 @@ -18,7 +18,7 @@ jobs: - name: Build artefacts run: npm run build:cjs && npm run build:bootstrap - name: Upload ${{ github.event.number }}/rollup.browser.js to bucket - uses: zdurham/s3-upload-github-action@1.0.1 + uses: zdurham/s3-upload-github-action@master with: args: --acl public-read env: From d574654a8e32c78c9b0972a64d32e3903d78acee Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 13 Apr 2021 14:41:22 +0200 Subject: [PATCH 10/20] Improve Action --- .github/workflows/{node-windows.yml => tests-windows.yml} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{node-windows.yml => tests-windows.yml} (91%) diff --git a/.github/workflows/node-windows.yml b/.github/workflows/tests-windows.yml similarity index 91% rename from .github/workflows/node-windows.yml rename to .github/workflows/tests-windows.yml index 786a4b3f323..468ae4a2aba 100644 --- a/.github/workflows/node-windows.yml +++ b/.github/workflows/tests-windows.yml @@ -1,4 +1,4 @@ -name: Node +name: Tests (Windows) on: push: @@ -14,7 +14,7 @@ jobs: matrix: node: [ '14', '12', '10' ] - name: ${{ matrix.node }} (Windows) + name: Node ${{ matrix.node }} steps: - name: Configure git line-breaks run: git config --global core.autocrlf false From 4c266754574dd7cd7a119f50fbd0d9d4757ba844 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 13 Apr 2021 14:45:16 +0200 Subject: [PATCH 11/20] Improve Action --- .github/workflows/repl-artefacts.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/repl-artefacts.yml b/.github/workflows/repl-artefacts.yml index c9df7b6bf1b..81493655bf3 100644 --- a/.github/workflows/repl-artefacts.yml +++ b/.github/workflows/repl-artefacts.yml @@ -5,6 +5,7 @@ on: jobs: upload: runs-on: ubuntu-latest + name: Upload steps: - name: Checkout Commit From aa7c152752217983e38bdcdb497944edf7458d46 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 13 Apr 2021 14:48:49 +0200 Subject: [PATCH 12/20] Improve Action --- .github/workflows/repl-artefacts.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/repl-artefacts.yml b/.github/workflows/repl-artefacts.yml index 81493655bf3..bf393e2bd58 100644 --- a/.github/workflows/repl-artefacts.yml +++ b/.github/workflows/repl-artefacts.yml @@ -20,8 +20,8 @@ jobs: run: npm run build:cjs && npm run build:bootstrap - name: Upload ${{ github.event.number }}/rollup.browser.js to bucket uses: zdurham/s3-upload-github-action@master - with: - args: --acl public-read +# with: +# args: --acl public-read env: FILE: dist/rollup.browser.js AWS_REGION: us-east-1 From 461f01978c320d40794d9b79a837f2131377a7ed Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 13 Apr 2021 14:55:56 +0200 Subject: [PATCH 13/20] Improve Action --- .github/workflows/repl-artefacts.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/repl-artefacts.yml b/.github/workflows/repl-artefacts.yml index bf393e2bd58..3b9653bca58 100644 --- a/.github/workflows/repl-artefacts.yml +++ b/.github/workflows/repl-artefacts.yml @@ -5,7 +5,6 @@ on: jobs: upload: runs-on: ubuntu-latest - name: Upload steps: - name: Checkout Commit From 3d69d4f0cbd4ef1ef3be9cc3412075a628cbfc11 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 13 Apr 2021 15:07:15 +0200 Subject: [PATCH 14/20] Improve Action --- .github/workflows/repl-artefacts.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/repl-artefacts.yml b/.github/workflows/repl-artefacts.yml index 3b9653bca58..8618fade45f 100644 --- a/.github/workflows/repl-artefacts.yml +++ b/.github/workflows/repl-artefacts.yml @@ -19,8 +19,8 @@ jobs: run: npm run build:cjs && npm run build:bootstrap - name: Upload ${{ github.event.number }}/rollup.browser.js to bucket uses: zdurham/s3-upload-github-action@master -# with: -# args: --acl public-read + with: + args: --cache-control max-age=300,public env: FILE: dist/rollup.browser.js AWS_REGION: us-east-1 From 9fa91b9ccdfee7a5ee7826a7694b29fc7547c5e4 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 13 Apr 2021 15:27:49 +0200 Subject: [PATCH 15/20] Improve Action --- .github/workflows/pr-comment.yml | 35 ---------------------- .github/workflows/repl-artefacts.yml | 44 +++++++++++++++++++++++++--- 2 files changed, 40 insertions(+), 39 deletions(-) delete mode 100644 .github/workflows/pr-comment.yml diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml deleted file mode 100644 index 3356fef8d49..00000000000 --- a/.github/workflows/pr-comment.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: PR Comment - -on: - pull_request_target: - -jobs: - comment: - runs-on: ubuntu-latest - steps: - - name: Find Comment - uses: peter-evans/find-comment@v1 - id: fc - with: - issue-number: ${{ github.event.pull_request.number }} - comment-author: 'github-actions[bot]' - body-includes: 'Thank you for your contribution!' - - name: Create comment - if: steps.fc.outputs.comment-id == '' - uses: peter-evans/create-or-update-comment@v1 - with: - issue-number: ${{ github.event.pull_request.number }} - body: | - ### Thank you for your contribution! ❤️ - - You can try out this pull request locally by installing Rollup via - - ```bash - npm install ${{ github.event.pull_request.head.repo.full_name }}#${{ github.event.pull_request.head.ref }} - ``` - - Once a build has completed, you can load it into the REPL by inserting the CircleCI build number of the **ci/circleci: node-v12-latest** build into the link below (unfortunately, we cannot auto-update this comment for PRs from forks at this time): - ``` - https://rollupjs.org/repl/?circleci= - ``` - diff --git a/.github/workflows/repl-artefacts.yml b/.github/workflows/repl-artefacts.yml index 8618fade45f..0f8bc128a16 100644 --- a/.github/workflows/repl-artefacts.yml +++ b/.github/workflows/repl-artefacts.yml @@ -17,14 +17,50 @@ jobs: run: npm ci --ignore-scripts - name: Build artefacts run: npm run build:cjs && npm run build:bootstrap - - name: Upload ${{ github.event.number }}/rollup.browser.js to bucket + - name: Upload "${{ github.event.pull_request.number }}/rollup.browser.js" to bucket uses: zdurham/s3-upload-github-action@master with: args: --cache-control max-age=300,public env: FILE: dist/rollup.browser.js - AWS_REGION: us-east-1 - S3_BUCKET: rollup-ci-artefacts - S3_KEY: ${{ github.event.number }}/rollup.browser.js + AWS_REGION: ${{ secrets.AWS_REGION }} + S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} + S3_KEY: ${{ github.event.pull_request.number }}/rollup.browser.js AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Upload "${{ github.event.pull_request.number }}/rollup.browser.js.map" to bucket + uses: zdurham/s3-upload-github-action@master + with: + args: --cache-control max-age=300,public + env: + FILE: dist/rollup.browser.js.map + AWS_REGION: ${{ secrets.AWS_REGION }} + S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} + S3_KEY: ${{ github.event.pull_request.number }}/rollup.browser.js.map + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Find Comment + uses: peter-evans/find-comment@v1 + id: fc + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: 'Thank you for your contribution!' + - name: Create or update comment + uses: peter-evans/create-or-update-comment@v1 + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + edit-mode: replace + body: | + ### Thank you for your contribution! ❤️ + + You can try out this pull request locally by installing Rollup via + + ```bash + npm install ${{ github.event.pull_request.head.repo.full_name }}#${{ github.event.pull_request.head.ref }} + ``` + + or load it into the REPL: + https://rollupjs.org/repl/?pr=${{ github.event.pull_request.number }} + From 9dcdf3cde4c216e5dda899bc0b67f123f8914bd1 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Wed, 14 Apr 2021 07:45:10 +0200 Subject: [PATCH 16/20] Improve Action --- .circleci/config.yml | 88 ---------------------------- .github/workflows/repl-artefacts.yml | 4 +- .github/workflows/tests-windows.yml | 32 ---------- .github/workflows/tests.yml | 85 +++++++++++++++++++++++++++ 4 files changed, 87 insertions(+), 122 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100644 .github/workflows/tests-windows.yml create mode 100644 .github/workflows/tests.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 4d35c8236d3..00000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,88 +0,0 @@ -version: 2 - -jobs: - analysis: - docker: - - image: rollupcabal/circleci-node-base:latest - steps: - - checkout - - restore_cache: - key: dependency-cache-{{ checksum "package-lock.json" }} - - run: - name: Installing Dependencies - command: npm ci --ignore-scripts - - run: - name: Running linting - command: npm run ci:lint - - run: - name: Running NPM Security Audit - command: npm run security - - save_cache: - key: dependency-cache-{{ checksum "package-lock.json" }} - paths: - - ./node_modules - node-v10-latest: - docker: - - image: rollupcabal/circleci-node-v10:latest - steps: - - checkout - - restore_cache: - key: dependency-cache-{{ checksum "package-lock.json" }} - - run: - name: Running tests - command: npm run ci:test - node-v12-latest: - docker: - - image: rollupcabal/circleci-node-v12:latest - steps: - - checkout - - restore_cache: - key: dependency-cache-{{ checksum "package-lock.json" }} - - run: - name: Running tests - command: npm run ci:test:only - - store_artifacts: - name: Storing browser build for REPL - path: /home/circleci/project/dist/rollup.browser.js - destination: rollup.browser.js - - run: - name: Post REPL comment - command: ./scripts/post-comment.js - node-v14-latest: - docker: - - image: rollupcabal/circleci-node-v14:latest - steps: - - checkout - - restore_cache: - key: dependency-cache-{{ checksum "package-lock.json" }} - - run: - name: Running tests with coverage - command: npm run ci:coverage - - -workflows: - version: 2 - validate-test: - jobs: - - analysis: - filters: - tags: - only: /.*/ - - node-v10-latest: - requires: - - analysis - filters: - tags: - only: /.*/ - - node-v12-latest: - requires: - - analysis - filters: - tags: - only: /.*/ - - node-v14-latest: - requires: - - analysis - filters: - tags: - only: /.*/ diff --git a/.github/workflows/repl-artefacts.yml b/.github/workflows/repl-artefacts.yml index 0f8bc128a16..bb301df1418 100644 --- a/.github/workflows/repl-artefacts.yml +++ b/.github/workflows/repl-artefacts.yml @@ -1,6 +1,7 @@ name: Upload REPL artefacts + on: - pull_request: + pull_request_target: jobs: upload: @@ -63,4 +64,3 @@ jobs: or load it into the REPL: https://rollupjs.org/repl/?pr=${{ github.event.pull_request.number }} - diff --git a/.github/workflows/tests-windows.yml b/.github/workflows/tests-windows.yml deleted file mode 100644 index 468ae4a2aba..00000000000 --- a/.github/workflows/tests-windows.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Tests (Windows) - -on: - push: - branches: - - master - pull_request: - -jobs: - build: - runs-on: windows-2019 - - strategy: - matrix: - node: [ '14', '12', '10' ] - - name: Node ${{ matrix.node }} - steps: - - name: Configure git line-breaks - run: git config --global core.autocrlf false - - name: Checkout Commit - uses: actions/checkout@v1 - - name: Setup Node - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node }} - - name: Install dependencies - run: npm ci --ignore-scripts - - name: Run tests - run: npm test - env: - CI: true diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000000..0adc71b378a --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,85 @@ +name: Tests + +on: + push: + branches: + - master + pull_request: + +jobs: + windows: + runs-on: windows-2019 + strategy: + matrix: + node: ['14', '12', '10'] + name: Node ${{ matrix.node }} (Windows) + steps: + - name: Configure git line-breaks + run: git config --global core.autocrlf false + - name: Checkout Commit + uses: actions/checkout@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + - name: Install dependencies + run: npm ci --ignore-scripts + - name: Run tests + run: npm test + env: + CI: true + + linux10: + runs-on: ubuntu-latest + name: Node 10 (Linux) + steps: + - name: Checkout Commit + uses: actions/checkout@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '10' + - name: Install dependencies + run: npm ci --ignore-scripts + - name: Run tests + run: npm ci:test:only + env: + CI: true + + linux12: + runs-on: ubuntu-latest + name: Node 12 + Extra Tests (Linux) + steps: + - name: Checkout Commit + uses: actions/checkout@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '12' + - name: Install dependencies + run: npm ci --ignore-scripts + - name: Lint + run: npm run ci:lint + - name: Vulnerabilities + run: npm run security + - name: Run all tests + run: npm ci:test + env: + CI: true + + linux14: + runs-on: ubuntu-latest + name: Node 14 + Coverage (Linux) + steps: + - name: Checkout Commit + uses: actions/checkout@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '14' + - name: Install dependencies + run: npm ci --ignore-scripts + - name: Run tests with coverage + run: npm run ci:coverage + env: + CI: true From ab5f0ebfd77521531ffd99041c425870a94ca269 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Wed, 14 Apr 2021 07:48:38 +0200 Subject: [PATCH 17/20] Improve Action --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0adc71b378a..6041157e75d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,7 +42,7 @@ jobs: - name: Install dependencies run: npm ci --ignore-scripts - name: Run tests - run: npm ci:test:only + run: npm run ci:test:only env: CI: true @@ -63,7 +63,7 @@ jobs: - name: Vulnerabilities run: npm run security - name: Run all tests - run: npm ci:test + run: npm run ci:test env: CI: true From 7dee5f53181f23bb9779626d88beac22baf3ade0 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Wed, 14 Apr 2021 07:55:32 +0200 Subject: [PATCH 18/20] Switch job order --- .github/workflows/tests.yml | 62 ++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6041157e75d..835b0c255db 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,79 +7,79 @@ on: pull_request: jobs: - windows: - runs-on: windows-2019 - strategy: - matrix: - node: ['14', '12', '10'] - name: Node ${{ matrix.node }} (Windows) + linux14: + runs-on: ubuntu-latest + name: Node 14 + Coverage (Linux) steps: - - name: Configure git line-breaks - run: git config --global core.autocrlf false - name: Checkout Commit uses: actions/checkout@v2 - name: Setup Node uses: actions/setup-node@v2 with: - node-version: ${{ matrix.node }} + node-version: '14' - name: Install dependencies run: npm ci --ignore-scripts - - name: Run tests - run: npm test + - name: Run tests with coverage + run: npm run ci:coverage env: CI: true - linux10: + linux12: runs-on: ubuntu-latest - name: Node 10 (Linux) + name: Node 12 + Extra Tests (Linux) steps: - name: Checkout Commit uses: actions/checkout@v2 - name: Setup Node uses: actions/setup-node@v2 with: - node-version: '10' + node-version: '12' - name: Install dependencies run: npm ci --ignore-scripts - - name: Run tests - run: npm run ci:test:only + - name: Lint + run: npm run ci:lint + - name: Vulnerabilities + run: npm run security + - name: Run all tests + run: npm run ci:test env: CI: true - linux12: + linux10: runs-on: ubuntu-latest - name: Node 12 + Extra Tests (Linux) + name: Node 10 (Linux) steps: - name: Checkout Commit uses: actions/checkout@v2 - name: Setup Node uses: actions/setup-node@v2 with: - node-version: '12' + node-version: '10' - name: Install dependencies run: npm ci --ignore-scripts - - name: Lint - run: npm run ci:lint - - name: Vulnerabilities - run: npm run security - - name: Run all tests - run: npm run ci:test + - name: Run tests + run: npm run ci:test:only env: CI: true - linux14: - runs-on: ubuntu-latest - name: Node 14 + Coverage (Linux) + windows: + runs-on: windows-2019 + strategy: + matrix: + node: ['14', '12', '10'] + name: Node ${{ matrix.node }} (Windows) steps: + - name: Configure git line-breaks + run: git config --global core.autocrlf false - name: Checkout Commit uses: actions/checkout@v2 - name: Setup Node uses: actions/setup-node@v2 with: - node-version: '14' + node-version: ${{ matrix.node }} - name: Install dependencies run: npm ci --ignore-scripts - - name: Run tests with coverage - run: npm run ci:coverage + - name: Run tests + run: npm test env: CI: true From bce68de434613fb8b5d0c3a4a53a46166887705f Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Wed, 14 Apr 2021 08:02:01 +0200 Subject: [PATCH 19/20] Run coverage on PR head --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 835b0c255db..b8e5e21b405 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,6 +13,9 @@ jobs: steps: - name: Checkout Commit uses: actions/checkout@v2 + # Coverage needs to run on the PR head instead of the merge commit + with: + ref: ${{ github.event.pull_request.head.sha }} - name: Setup Node uses: actions/setup-node@v2 with: From 62c4e14905c23021accb39bea7c8c80cea4e01cd Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Wed, 14 Apr 2021 08:15:39 +0200 Subject: [PATCH 20/20] Run all tests against head --- .github/workflows/tests.yml | 7 ++++- scripts/post-comment.js | 61 ------------------------------------- 2 files changed, 6 insertions(+), 62 deletions(-) delete mode 100755 scripts/post-comment.js diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b8e5e21b405..5207d68510e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,6 @@ jobs: steps: - name: Checkout Commit uses: actions/checkout@v2 - # Coverage needs to run on the PR head instead of the merge commit with: ref: ${{ github.event.pull_request.head.sha }} - name: Setup Node @@ -33,6 +32,8 @@ jobs: steps: - name: Checkout Commit uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} - name: Setup Node uses: actions/setup-node@v2 with: @@ -54,6 +55,8 @@ jobs: steps: - name: Checkout Commit uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} - name: Setup Node uses: actions/setup-node@v2 with: @@ -76,6 +79,8 @@ jobs: run: git config --global core.autocrlf false - name: Checkout Commit uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} - name: Setup Node uses: actions/setup-node@v2 with: diff --git a/scripts/post-comment.js b/scripts/post-comment.js deleted file mode 100755 index 2e29de90ae0..00000000000 --- a/scripts/post-comment.js +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env node - -const path = require('path'); -const fetch = require('node-fetch'); - -const authToken = process.env.GH_AUTH_TOKEN; -if (!authToken) { - console.log('Could not find auth token.'); - process.exit(0); -} - -const prNumber = path.basename( - process.env.CIRCLE_PULL_REQUEST || process.env.CI_PULL_REQUEST || '' -); -if (!prNumber) { - console.log('No pull request number found'); - process.exit(0); -} - -const headline = '### Thank you for your contribution! ❤️'; - -postComment(); - -async function postComment() { - const existingId = await findExistingComment(); - console.log(existingId ? `Update comment ${existingId}` : 'Create new comment.'); - const installPath = await getInstallPath(); - const path = existingId ? `issues/comments/${existingId}` : `issues/${prNumber}/comments`; - const method = existingId ? 'PATCH' : 'POST'; - await fetch(getApiUrl(path), { - method, - body: JSON.stringify({ - body: `${headline} - -You can try out this pull request locally by installing Rollup via - -\`\`\` -npm install ${installPath} -\`\`\` - -or load it into the REPL: -https://rollupjs.org/repl/?circleci=${process.env.CIRCLE_BUILD_NUM} -` - }) - }); -} - -async function findExistingComment() { - const comments = await (await fetch(getApiUrl(`issues/${prNumber}/comments`), {})).json(); - const existingComment = comments.find(comment => comment.body.startsWith(headline)); - return existingComment && existingComment.id; -} - -async function getInstallPath() { - const prInfo = await (await fetch(getApiUrl(`pulls/${prNumber}`), {})).json(); - return `${prInfo.head.repo.full_name}#${prInfo.head.ref}`; -} - -function getApiUrl(path) { - return `https://${authToken}:x-oauth-basic@api.github.com/repos/rollup/rollup/${path}`; -}