Skip to content

Commit 549578e

Browse files
authored
Merge pull request #528 from simply-alliv/v2
chore: add initial setup for Github Actions
2 parents 6a3640f + ab9d985 commit 549578e

4 files changed

Lines changed: 127 additions & 27 deletions

File tree

.github/workflows/main.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: CICD
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches:
7+
- v2
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [10.x]
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
25+
- run: npm ci
26+
- run: npm run test:ci
27+
28+
- name: Coveralls Parallel
29+
uses: coverallsapp/github-action@v1.1.0
30+
env:
31+
NODE_COVERALLS_DEBUG: 1
32+
COVERALLS_SERVICE_NAME: Github Actions
33+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
34+
COVERALLS_GIT_BRANCH: v2
35+
with:
36+
github-token: ${{ secrets.GITHUB_TOKEN }}
37+
flag-name: run-${{ matrix.node-version }}
38+
parallel: true
39+
40+
finish-test:
41+
needs: test
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Coveralls Finished
45+
uses: coverallsapp/github-action@v1.1.0
46+
with:
47+
github-token: ${{ secrets.GITHUB_TOKEN }}
48+
parallel-finished: true
49+
50+
build:
51+
if: ${{ github.event_name == 'push' && github.repository == 'microapidev/auth-microapi' }}
52+
needs: finish-test
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v2
56+
- uses: akhileshns/heroku-deploy@v3.4.6 # This is the action
57+
with:
58+
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
59+
heroku_app_name: "authentication-microapi-v2" #Must be unique in Heroku
60+
heroku_email: "allistair.vilakazi@gmail.com"

bin/coveralls.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env node
2+
3+
'use strict';
4+
5+
const { handleInput } = require('..');
6+
7+
process.stdin.resume();
8+
process.stdin.setEncoding('utf8');
9+
10+
let input = '';
11+
12+
process.stdin.on('data', chunk => {
13+
input += chunk;
14+
});
15+
16+
process.stdin.on('end', () => {
17+
handleInput(input, err => {
18+
if (err) {
19+
throw err;
20+
}
21+
});
22+
});

package-lock.json

Lines changed: 43 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"test": "cross-env NODE_ENV=test jest",
88
"test:watch": "cross-env NODE_ENV=test jest --watch",
99
"test:cover": "cross-env NODE_ENV=test jest --coverage",
10-
"test:ci": "cross-env NODE_ENV=test jest --coverage && cat ./coverage/lcov.info | coveralls",
10+
"test:ci": "cross-env NODE_ENV=test jest --coverage && shx cat ./coverage/lcov.info",
1111
"lint": "eslint \"src/**/*.js\"",
1212
"lint:fix": "eslint --fix \"src/**/*.js\"",
1313
"build": "babel src --out-dir dist --delete-dir-on-start --ignore '**/*.test.js'",
@@ -48,13 +48,13 @@
4848
"@babel/node": "^7.10.1",
4949
"@babel/preset-env": "^7.10.2",
5050
"babel-jest": "^26.0.1",
51-
"coveralls": "^3.1.0",
5251
"eslint": "^7.2.0",
5352
"eslint-config-prettier": "^6.11.0",
5453
"eslint-plugin-prettier": "^3.1.3",
5554
"jest": "^26.0.1",
5655
"nodemon": "^2.0.4",
5756
"prettier": "^2.0.5",
57+
"shx": "^0.3.2",
5858
"supertest": "^4.0.2"
5959
}
6060
}

0 commit comments

Comments
 (0)