Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce CI #126

Merged
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: NodeJS SDK CI

on:
workflow_dispatch:
push:
branches:
- master
- support/SDK-V3
- feature/**
- bugfix/**
pull_request:
branches:
- master
- support/SDK-V3
- feature/**
- bugfix/**
jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [8.x ,10.x, 12.x ,14.x ,16.x]

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 install
- run: npm run build --if-present
- run: npm run test

code-coverage:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [ 8.x ]

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 install
- run: npm ci
- run: npm run build --if-present
- run: npm run test-coverage

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
78 changes: 78 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Update Documentation

on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
documentation:
# Generate documentation and push to gh-pages branch using the predefined JDK versions in the strategy section
name: Documentation
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [ 8.x ]

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 install
- run: npm run docs

- name: Copy to documentation Website Location
run: |
mkdir ../gh-pages
cp -r docs/* ../gh-pages/
cd ../gh-pages

- name: Commit documentation changes
run: |
if [[ `git status --porcelain` ]]; then
echo "Commit documentation"
# Set identity
git config --global user.email "[email protected]"
git config --global user.name "Git Action Doc"

# Add branch
git checkout -B gh-pages

# Push generated files
git add -A
git commit -m "Documentation updated"
git push origin gh-pages -fq > /dev/null
fi
code-coverage:
grmeyer-hw-dev marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [ 8.x ]

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 install
- run: npm ci
- run: npm run build --if-present
- run: npm run test-coverage

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"docs": "esdoc -c ./.esdoc.json",
"deploy-docs": "npm run docs && gh-pages -d docs",
"test": "npm run lint && npm run test-unit",
"test-unit": "mocha --compilers js:babel-register test/**/*.js test/*.js",
"test-unit": "nyc --reporter lcov mocha --require babel-core/register test/**/*.js test/*.js",
"test-coverage": "nyc npm run test",
"coveralls": "npm run test-coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
"prepublish-prod": "npm test && npm run prod",
Expand Down