Merge pull request #1671 from bitcoinjs/feature/githubActions

Use Github Actions for CI
This commit is contained in:
Jonathan Underwood 2021-02-04 12:03:02 +09:00 committed by GitHub
commit 950e4717a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 80 additions and 29 deletions

80
.github/workflows/main_ci.yml vendored Normal file
View 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

View file

@ -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