-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Github Actions CI and release workflows
- Loading branch information
1 parent
fb79e02
commit f35ce05
Showing
2 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node: | ||
- 'lts/*' | ||
- 'current' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use node version ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
check-latest: true | ||
- run: npm ci | ||
|
||
- name: Tests | ||
run: npm run test | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "*" | ||
check-latest: true | ||
- run: npm ci | ||
|
||
- name: Linter | ||
run: npm run lint | ||
|
||
coverage: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- test | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "*" | ||
check-latest: true | ||
- run: npm ci | ||
- run: npm install -g codecov | ||
|
||
- name: Run tests with coverage | ||
run: ./node_modules/.bin/nyc --reporter=text --reporter=lcovonly npm test | ||
|
||
- name: Codecov | ||
run: codecov --disable=gcov | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- test | ||
- lint | ||
- coverage | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "*" | ||
check-latest: true | ||
- run: npm ci | ||
|
||
- name: Clean | ||
run: npm run build:clean | ||
|
||
- name: Build | ||
run: npm run build:npm | ||
|
||
- name: NPM Init | ||
run: npm init --yes | ||
|
||
- name: NPM publish dry run | ||
run: npm publish --dry-run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "*" | ||
check-latest: true | ||
- run: npm ci | ||
|
||
- name: Clean | ||
run: npm run build:clean | ||
|
||
- name: Build | ||
run: npm run build:npm | ||
|
||
- name: NPM Init | ||
run: npm init --yes | ||
|
||
- name: NPM publish dry run | ||
run: npm publish |