Skip to content

Commit

Permalink
build(*): migrate from travis to github actions
Browse files Browse the repository at this point in the history
Co-authored-by: Rachna <rachna@graype.in>
  • Loading branch information
sanjayaksaxena and rachnachakraborty committed Oct 14, 2023
1 parent 6b3b3cb commit 52a26f8
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 2 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on: ["push", "pull_request"]

name: Coveralls

jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v1

- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: npm install
run: |
npm install
npm run pretest
npm run test
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
format: lcov
debug: true
allow-empty: false
32 changes: 32 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm run pretest
- run: npm run test
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"main": "src/wink-naive-bayes-text-classifier.js",
"scripts": {
"pretest": "npm run lint && npm run docs",
"test": "nyc --reporter=html --reporter=text mocha ./test/",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"test": "nyc --reporter=html --reporter=lcov --reporter=text mocha ./test/",
"sourcedocs": "docker -i src -o ./sourcedocs --sidebar no",
"docs": "jsdoc src/*.js -c .jsdoc.json",
"lint": "eslint ./src/*.js ./test/*.js ./runkit/*.js"
Expand Down

0 comments on commit 52a26f8

Please sign in to comment.