Skip to content

ci: added github workflow build #95

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
44 changes: 44 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build
on: [pull_request, workflow_dispatch]

jobs:
build:
name: build
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '12', '14', '16' ]
serverless-version: ['latest', 'latest~1', 'latest~2']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- run: npm install
- run: npm install --no-save --ignore-scripts `npx npm-get-version serverless@$SERVERLESS_VERSION`
env:
SERVERLESS_VERSION: ${{ matrix.serverless-version }}
- run: npm run lint
- run: npm test

- name: Coveralls Parallel
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
flag-name: run-${{ matrix.node }}
# This is a parallel build so need this
parallel: true

# As testing against multiple versions need this to
# finish the parallel build
finish:
name: Coveralls coverage
needs: build
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"scripts": {
"clean": "rimraf dist",
"test-bare": "npm run compile && mocha ./dist/test/**/*.test.js",
"test": "nyc mocha --require ts-node/register --require source-map-support/register ./src/test/**/*.test.ts",
"test": "nyc --reporter=lcovonly mocha --require ts-node/register --require source-map-support/register ./src/test/**/*.test.ts",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"compile": "tsc",
"watch": "tsc -w",
Expand Down