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

feat: add checks workflow #11

Merged
merged 9 commits into from
Oct 19, 2022
Merged
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
79 changes: 79 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: CI Checks

on:
pull_request:
types: [opened, synchronize]
push:
branches: [main]

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
container:
image: node:18-alpine3.16
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: npm
- name: Install package dependencies
run: npm ci
- name: Run ESLint
run: npm run lint
build:
name: Build
runs-on: ubuntu-latest
container:
image: node:18-alpine3.16
needs: [lint]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: npm
- name: Install package dependencies
run: npm ci
- name: Run ESLint
run: npm run build
test:
name: Tests
runs-on: ubuntu-latest
container:
image: node:18-alpine3.16
needs: [build]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: npm
- name: Install package dependencies
run: npm ci
- name: Run tests
run: npm run test
coverage:
name: Coverage
runs-on: ubuntu-latest
container:
image: node:18-alpine3.16
needs: [build]
environment: development
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: npm
- name: Install package dependencies
run: npm ci
- name: Run coverage
run: npm run cover
- name: Coveralls
uses: coverallsapp/github-action@master
with:
path-to-lcov: ./.coverage/lcov.info
flag-name: Unit
github-token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 1 addition & 2 deletions .nycrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"all": true,
"cache": true,
"check-coverage": true,
"branches": 80,
"lines": 80,
"functions": 80,
Expand Down Expand Up @@ -43,7 +42,7 @@
"reporter": [
"text",
"text-summary",
"html"
"lcov"
],
"instrument": true,
"sourceMap": true
Expand Down