chore(ci): replace travis with gh actions

pull/909/head^2
Shahar Or (mightyiam) 4 years ago committed by Shahar Dawn Or
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,20 +1,5 @@
# Contributing
## Allowing CI builds of pull requests from forks
Some secrets are included as environment variables in the CI build.
Since code in forks is considered un-trusted,
CI builds of pull requests from forks are run without secrets.
This causes the CI build to fail.
To mark the HEAD of a pull request as trusted
— which would trigger a build that includes the secrets —
run the following command:
```sh
npm run mark-pr-head-as-trusted -- <pr number>
```
## Making a release
Make sure you have permission to publish, by running

@ -5,6 +5,7 @@
"rules": {
"scope-empty": [2, "never"],
"scope-enum": [2, "always", [
"ci",
"commitlint",
"deps",
"docs",

@ -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.\
`)
})()

1283
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -62,9 +62,7 @@
"latest-snabbdom-release": "npm:snabbdom@2.1.0",
"lodash.shuffle": "4.2.0",
"mathjs": "7.2.0",
"meow": "7.1.1",
"mocha": "8.1.3",
"nodegit": "0.27.0",
"npm-run-all": "4.1.5",
"p-map-series": "2.1.0",
"p-reduce": "2.1.0",

Loading…
Cancel
Save