Use Github Actions for CI
This commit is contained in:
parent
533d6c2e6d
commit
f5217e3acb
2 changed files with 80 additions and 29 deletions
80
.github/workflows/main_ci.yml
vendored
Normal file
80
.github/workflows/main_ci.yml
vendored
Normal file
|
@ -0,0 +1,80 @@
|
|||
name: Run Tests
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
unit:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
registry-url: https://registry.npmjs.org/
|
||||
- run: npm ci
|
||||
- run: npm run unit
|
||||
coverage:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
registry-url: https://registry.npmjs.org/
|
||||
- run: npm ci
|
||||
- run: npm run coverage
|
||||
integration:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
regtest:
|
||||
image: junderw/bitcoinjs-regtest-server@sha256:a46ec1a651ca5b1a5408f2b2526ea5f435421dd2bc2f28fae3bc33e1fd614552
|
||||
ports:
|
||||
- 8080:8080
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
registry-url: https://registry.npmjs.org/
|
||||
- run: npm ci
|
||||
- run: APIURL=http://127.0.0.1:8080/1 npm run integration
|
||||
format:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
registry-url: https://registry.npmjs.org/
|
||||
- run: npm ci
|
||||
- run: npm run format:ci
|
||||
gitdiff:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
registry-url: https://registry.npmjs.org/
|
||||
- run: npm ci
|
||||
- run: npm run gitdiff:ci
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
registry-url: https://registry.npmjs.org/
|
||||
- run: npm ci
|
||||
- run: npm run lint
|
||||
lint-tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
registry-url: https://registry.npmjs.org/
|
||||
- run: npm ci
|
||||
- run: npm run lint:tests
|
29
.travis.yml
29
.travis.yml
|
@ -1,29 +0,0 @@
|
|||
sudo: false
|
||||
language: node_js
|
||||
services:
|
||||
- docker
|
||||
before_install:
|
||||
- if [ $TEST_SUITE = "integration" ]; then
|
||||
docker pull junderw/bitcoinjs-regtest-server &&
|
||||
docker run -d -p 127.0.0.1:8080:8080 junderw/bitcoinjs-regtest-server &&
|
||||
docker ps -a;
|
||||
fi
|
||||
node_js:
|
||||
- "8"
|
||||
- "lts/*"
|
||||
matrix:
|
||||
include:
|
||||
- node_js: "lts/*"
|
||||
env: TEST_SUITE=format:ci
|
||||
- node_js: "lts/*"
|
||||
env: TEST_SUITE=gitdiff:ci
|
||||
- node_js: "lts/*"
|
||||
env: TEST_SUITE=lint
|
||||
- node_js: "lts/*"
|
||||
env: TEST_SUITE=lint:tests
|
||||
- node_js: "lts/*"
|
||||
env: TEST_SUITE=coverage
|
||||
env:
|
||||
- TEST_SUITE=unit
|
||||
- TEST_SUITE=integration APIURL=http://127.0.0.1:8080/1
|
||||
script: npm run-script $TEST_SUITE
|
Loading…
Reference in a new issue