chore(ci): replace travis with gh actions
parent
275c299e95
commit
d04b7ad435
@ -0,0 +1,26 @@
|
||||
name: CI
|
||||
|
||||
on: pull_request
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
runs-on: ubuntu-latest
|
||||
environment: ci
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Turnstyle
|
||||
uses: softprops/turnstyle@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Read .nvmrc
|
||||
run: echo ::set-output name=node-version::$(cat .nvmrc)
|
||||
id: nvm
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ steps.nvm.outputs.node-version }}
|
||||
- run: npm ci
|
||||
- run: npx run-s test docs check-clean
|
||||
env:
|
||||
BROWSER_STACK_USERNAME: ${{ secrets.BROWSER_STACK_USERNAME }}
|
||||
BROWSER_STACK_ACCESS_KEY: ${{ secrets. BROWSER_STACK_ACCESS_KEY }}
|
@ -1,7 +0,0 @@
|
||||
sudo: false
|
||||
language: node_js
|
||||
node_js:
|
||||
- "v15.8.0"
|
||||
script:
|
||||
- commitlint-travis --config commitlint.config.json
|
||||
- run-s test docs check-clean
|
@ -1,43 +0,0 @@
|
||||
const Git = require('nodegit')
|
||||
const assert = require('assert')
|
||||
const meow = require('meow');
|
||||
|
||||
/**
|
||||
* For reference, the unix shell equivalent of this script is kind of:
|
||||
*
|
||||
* ```sh
|
||||
* # `ORIGIN` is your remote name for the Snabbdom repository.
|
||||
* # `PR` is the pull request number
|
||||
* REF=refs/remotes/$ORIGIN/pull/$PR/head
|
||||
* git fetch $ORIGIN +refs/pull/$PR/head:$REF
|
||||
* BRANCH=allow-ci_$PR
|
||||
* git push $ORIGIN +${REF}:refs/heads/$BRANCH
|
||||
* ```
|
||||
*/
|
||||
|
||||
(async function () {
|
||||
const [pr] = meow({ hardRejection: false }).input
|
||||
assert.notStrictEqual(pr, undefined)
|
||||
const repo = await Git.Repository.open(__dirname)
|
||||
const remote = (await repo.getRemotes())
|
||||
.find(r => r.url() === 'git@github.com:snabbdom/snabbdom.git')
|
||||
assert.notStrictEqual(remote, undefined)
|
||||
const ref = `refs/remotes/${remote.name()}/pull/${pr}/head`
|
||||
const credentials = (url, userName) => Git.Cred
|
||||
.sshKeyFromAgent(userName)
|
||||
await remote
|
||||
.fetch(
|
||||
[`+refs/pull/${pr}/head:${ref}`],
|
||||
{ callbacks: { credentials } }
|
||||
)
|
||||
const branchName = `allow-ci_${pr}`
|
||||
await remote
|
||||
.push(
|
||||
[`+${ref}:refs/heads/${branchName}`],
|
||||
{ callbacks: { credentials } }
|
||||
)
|
||||
console.log(`\
|
||||
Marked head of pull request #${pr} as trusted by pushing it to branch \`${branchName}\`.
|
||||
As soon as the pull request is closed/merged, this branch can be deleted.\
|
||||
`)
|
||||
})()
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue