From cedbe4ad474579beab2393a3041814877a37fbf8 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Sat, 2 May 2020 14:46:15 +0900 Subject: [PATCH 1/9] Add ci workflow --- .github/workflows/ci.yml | 92 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..364ecb0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,92 @@ +name: CI +on: + push: + branches: [master] + pull_request: + branches: [master] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12.x + - run: npm ci + - run: npm run clean + - run: npm run test + - run: npm run package + - uses: actions/upload-artifact@v2 + with: + name: dist + path: dist + + test: + needs: [build] + runs-on: ubuntu-latest + strategy: + matrix: + target: [built, committed] + steps: + - if: github.event_name == 'push' + uses: actions/checkout@v2 + - if: github.event_name == 'pull_request' + uses: actions/checkout@v2 + with: + ref: ${{ github.head_ref }} + - if: matrix.target == 'built' + uses: actions/download-artifact@v2 + with: + name: dist + path: dist + + - name: Create change + run: date +%s > report.txt + + - name: Create Pull Request + id: cpr + uses: ./ + with: + commit-message: '[CI] test ${{ matrix.target }}' + committer: GitHub + author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> + title: '[CI] test ${{ matrix.target }}' + body: | + - CI test case for target '${{ matrix.target }}' + + Auto-generated by [create-pull-request][1] + + [1]: https://github.com/peter-evans/create-pull-request + branch: ci-test-${{ matrix.target }} + + - name: Close Pull + uses: peter-evans/close-pull@v1 + with: + pull-request-number: ${{ steps.cpr.outputs.pr_number }} + comment: '[CI] test ${{ matrix.target }}' + delete-branch: true + + package: + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + needs: [test] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/download-artifact@v2 + with: + name: dist + path: dist + - name: Create Pull Request + uses: peter-evans/create-pull-request@v2 + with: + commit-message: Update distribution + committer: GitHub + author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> + title: Update distribution + body: | + - Updates the distribution for changes on `master` + + Auto-generated by [create-pull-request][1] + + [1]: https://github.com/peter-evans/create-pull-request + branch: update-distribution From 9f95ac6c5371dfae16b2257f8e39b2699c8dff70 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Sat, 2 May 2020 14:50:21 +0900 Subject: [PATCH 2/9] Setup python for missing pip dependency --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 364ecb0..4c6c80c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,9 @@ jobs: - uses: actions/setup-node@v1 with: node-version: 12.x + - uses: actions/setup-python@v2 + with: + python-version: '3.x' - run: npm ci - run: npm run clean - run: npm run test From 755b39d2ffb089d5e332f582957b5ddae871e972 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Sat, 2 May 2020 14:55:07 +0900 Subject: [PATCH 3/9] Pin dependencies --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index ab92b40..c92229d 100644 --- a/package.json +++ b/package.json @@ -23,10 +23,10 @@ }, "homepage": "https://github.com/peter-evans/create-pull-request", "dependencies": { - "@actions/core": "^1.1.1", - "@actions/exec": "^1.0.1", - "@actions/tool-cache": "^1.1.2", - "is-docker": "^2.0.0" + "@actions/core": "1.2.0", + "@actions/exec": "1.0.2", + "@actions/tool-cache": "1.1.2", + "is-docker": "2.0.0" }, "devDependencies": { "@zeit/ncc": "0.22.1", From ee96ad03d95a6eecdb852fd24c9a2f8fdb63a115 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Sat, 2 May 2020 14:55:39 +0900 Subject: [PATCH 4/9] Auto merge dev dependency updates --- renovate.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/renovate.json b/renovate.json index f45d8f1..90b4626 100644 --- a/renovate.json +++ b/renovate.json @@ -1,5 +1,11 @@ { "extends": [ "config:base" + ], + "packageRules": [ + { + "depTypeList": ["devDependencies"], + "automerge": true + } ] } From d4024e28763be6309e04ebf59ea22781f601e205 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Sat, 2 May 2020 15:13:50 +0900 Subject: [PATCH 5/9] Add test suite help comment --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c6c80c..a991474 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,6 +69,30 @@ jobs: comment: '[CI] test ${{ matrix.target }}' delete-branch: true + testSuiteHelp: + if: github.event_name == 'pull_request' + needs: [test] + runs-on: ubuntu-latest + steps: + - name: Find Comment + uses: peter-evans/find-comment@v1 + id: fc + with: + issue-number: ${{ github.event.number }} + comment-author: github-actions + body-includes: Full test suite slash command + + - if: steps.fc.outputs.comment-id == '' + name: Create comment + uses: peter-evans/create-or-update-comment@v1 + with: + issue-number: ${{ github.event.number }} + body: | + Full test suite slash command (repository admin only) + ``` + /test repository=${{ github.event.pull_request.head.repo.full_name }} branch=${{ github.event.pull_request.head.ref }} + ``` + package: if: github.event_name == 'push' && github.ref == 'refs/heads/master' needs: [test] From 6295d61f0c879d16b688c4d29ad963987d0b493e Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Sat, 2 May 2020 15:19:44 +0900 Subject: [PATCH 6/9] Rename job --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a991474..b76e8f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,7 +69,7 @@ jobs: comment: '[CI] test ${{ matrix.target }}' delete-branch: true - testSuiteHelp: + commentTestSuiteHelp: if: github.event_name == 'pull_request' needs: [test] runs-on: ubuntu-latest From 237244614a194a57a2e6b07aea12b32c1ce93b82 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Sat, 2 May 2020 15:25:52 +0900 Subject: [PATCH 7/9] Remove author search condition --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b76e8f8..cd4d34e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,6 @@ jobs: id: fc with: issue-number: ${{ github.event.number }} - comment-author: github-actions body-includes: Full test suite slash command - if: steps.fc.outputs.comment-id == '' From 08595270b5ce9be753b13f1c5072f1ee3fda66aa Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Sat, 2 May 2020 15:32:34 +0900 Subject: [PATCH 8/9] Filter by comment author --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd4d34e..2288e67 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,6 +79,7 @@ jobs: id: fc with: issue-number: ${{ github.event.number }} + comment-author: 'github-actions[bot]' body-includes: Full test suite slash command - if: steps.fc.outputs.comment-id == '' From 1f4e24248b6281800b80b6a6a5167708bc27feb7 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Sat, 2 May 2020 16:02:02 +0900 Subject: [PATCH 9/9] Update test suite command --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2288e67..4789893 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,7 +90,7 @@ jobs: body: | Full test suite slash command (repository admin only) ``` - /test repository=${{ github.event.pull_request.head.repo.full_name }} branch=${{ github.event.pull_request.head.ref }} + /test repository=${{ github.event.pull_request.head.repo.full_name }} branch=${{ github.event.pull_request.head.ref }} build=true ``` package: