commit
95d6677567
3 changed files with 129 additions and 4 deletions
119
.github/workflows/ci.yml
vendored
Normal file
119
.github/workflows/ci.yml
vendored
Normal file
|
@ -0,0 +1,119 @@
|
||||||
|
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
|
||||||
|
- uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: '3.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 <noreply@github.com>
|
||||||
|
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
|
||||||
|
|
||||||
|
commentTestSuiteHelp:
|
||||||
|
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[bot]'
|
||||||
|
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 }} build=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 <noreply@github.com>
|
||||||
|
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
|
|
@ -23,10 +23,10 @@
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/peter-evans/create-pull-request",
|
"homepage": "https://github.com/peter-evans/create-pull-request",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.1.1",
|
"@actions/core": "1.2.0",
|
||||||
"@actions/exec": "^1.0.1",
|
"@actions/exec": "1.0.2",
|
||||||
"@actions/tool-cache": "^1.1.2",
|
"@actions/tool-cache": "1.1.2",
|
||||||
"is-docker": "^2.0.0"
|
"is-docker": "2.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@zeit/ncc": "0.22.1",
|
"@zeit/ncc": "0.22.1",
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
{
|
{
|
||||||
"extends": [
|
"extends": [
|
||||||
"config:base"
|
"config:base"
|
||||||
|
],
|
||||||
|
"packageRules": [
|
||||||
|
{
|
||||||
|
"depTypeList": ["devDependencies"],
|
||||||
|
"automerge": true
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue