Skip to content

Commit

Permalink
Merge pull request #57 from aron123/ci/gh-actions
Browse files Browse the repository at this point in the history
Add Github Actions workflow
  • Loading branch information
aron123 committed Feb 1, 2022
2 parents 5beff52 + 1c17e1f commit 0186ff3
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 23 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Integration test

on:
schedule:
- cron: '20 2 * * 7' # 2:20 on Sunday

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ 'ubuntu-latest', 'windows-latest' ]
node_version: [ '16' ]
architecture: [ 'x64' ]
name: Integration testing on ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node_version }}
architecture: ${{ matrix.architecture }}

- name: Install dependencies
run: npm install

- name: Run integration test
run: npm run integration-test
env:
BARION_POS_KEY: ${{ secrets.BARION_POS_KEY }}
BARION_USER_NAME: ${{ secrets.BARION_USER_NAME }}
BARION_PASSWORD: ${{ secrets.BARION_PASSWORD }}
BARION_ACCOUNT_ID: ${{ secrets.BARION_ACCOUNT_ID }}
BARION_CALLBACK_URL: ${{ secrets.BARION_CALLBACK_URL }}
BARION_REDIRECT_URL: ${{ secrets.BARION_REDIRECT_URL }}
BARION_STATEMENT_YEAR: ${{ secrets.BARION_STATEMENT_YEAR }}
BARION_STATEMENT_MONTH: ${{ secrets.BARION_STATEMENT_MONTH }}
48 changes: 48 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: build

on: [ 'push', 'pull_request', 'workflow_dispatch' ]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ 'ubuntu-latest', 'windows-latest' ]
node_version: [ '12', '14', '16' ]
architecture: [ 'x64' ]
name: Node ${{ matrix.node_version }}_${{ matrix.architecture }} on ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node_version }}
architecture: ${{ matrix.architecture }}

- name: Install dependencies
run: npm install

- name: Test code, generate coverage report
run: npm run coverage

- name: Register coverage report
uses: coverallsapp/github-action@master
with:
github-token: ${{ github.token }}
flag-name: Node ${{ matrix.node_version }}_${{ matrix.architecture }} on ${{ matrix.os }}
parallel: true

report-coverage:
name: Summarize and report coverage

needs: test
runs-on: ubuntu-latest

steps:
- name: Report coverage
uses: coverallsapp/github-action@master
with:
github-token: ${{ github.token }}
parallel-finished: true
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# node-barion
[![Build Status](https://travis-ci.com/aron123/node-barion.svg?branch=master)](https://travis-ci.com/aron123/node-barion)
[![Build Status](https://github.com/aron123/node-barion/actions/workflows/main.yml/badge.svg)](https://github.com/aron123/node-barion/actions/workflows/main.yml)
[![Coverage Status](https://coveralls.io/repos/github/aron123/node-barion/badge.svg?branch=master)](https://coveralls.io/github/aron123/node-barion?branch=master)
[![npm version](http://img.shields.io/npm/v/node-barion.svg?style=flat)](https://npmjs.org/package/node-barion "View this project on npm")
[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
"lint": "eslint .",
"test": "mocha test/*.test.js",
"integration-test": "mocha test/*.test.js test/integration/*.test.js",
"coverage": "nyc --all --reporter=text --reporter=lcov npm test",
"report-coverage": "nyc report --all --reporter=text-lcov | coveralls"
"coverage": "nyc --all --reporter=text --reporter=lcov npm test"
},
"devDependencies": {
"chai": "^4.2.0",
Expand Down

0 comments on commit 0186ff3

Please sign in to comment.