Skip to content

Commit

Permalink
feat: Add github build and test workflow (#14)
Browse files Browse the repository at this point in the history
Replaces CircleCI with Github Actions
  • Loading branch information
harrygr authored and harrygr committed Nov 7, 2019
1 parent 5c48b7e commit 40e2af9
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 57 deletions.
57 changes: 0 additions & 57 deletions .circleci/config.yml

This file was deleted.

58 changes: 58 additions & 0 deletions .github/workflows/build-n-test.yml
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 }}

0 comments on commit 40e2af9

Please sign in to comment.