-
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.
feat: Add github build and test workflow (#14)
Replaces CircleCI with Github Actions
- Loading branch information
Showing
2 changed files
with
58 additions
and
57 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,58 @@ | ||
name: Node CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build-n-test: | ||
name: Build and test | ||
runs-on: ubuntu-18.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Use Node.js 10.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 10.x | ||
|
||
- name: Cache node modules | ||
uses: actions/cache@v1 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.OS }}-deps-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.OS }}-deps-${{ hashFiles('**/yarn.lock') }} | ||
${{ runner.OS }}-deps- | ||
- name: Install deps | ||
run: yarn install | ||
|
||
- name: Build js | ||
run: yarn build | ||
|
||
- name: Run tests | ||
run: yarn test --coverage | ||
|
||
- name: Upload built package | ||
uses: actions/upload-artifact@v1.0.0 | ||
with: | ||
name: dist | ||
path: dist | ||
|
||
|
||
publish: | ||
runs-on: ubuntu-18.04 | ||
needs: build-n-test | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Download built package | ||
uses: actions/download-artifact@v1.0.0 | ||
with: | ||
name: dist | ||
|
||
- name: Semantic release | ||
run: npx semantic-release | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} |