Skip to content

Commit

Permalink
ci: add codeclimate workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdyman committed Jan 27, 2020
1 parent a1faca1 commit a9798f5
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 10 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
name: build

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
version: 12.x
- name: install yarn
run: npm install -g yarn
- name: yarn install, build, and test
run: |
yarn install --frozen-lockfile
yarn build
yarn test
- name: install
run: yarn install --frozen-lockfile
- name: build
run: yarn build
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: test
on: push

jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
- name: Install
run: yarn install --frozen-lockfile
- name: test
run: yarn test --ci --coverage
- name: Report
run: |
export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter format-coverage -t lcov coverage/lcov.info
./cc-test-reporter upload-coverage
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
- uses: actions/upload-artifact@master
with:
name: coverage
path: coverage
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
<a href="https://bundlephobia.com/result?p=react-compare-slider">
<img src="https://img.shields.io/bundlephobia/minzip/react-compare-slider.svg" alt="Bundle size">
</a>
<br/>
<a href="https://github.com/nerdyman/react-compare-slider/actions?query=workflow%3Abuild">
<img src="https://github.com/nerdyman/react-compare-slider/workflows/build/badge.svg" alt="Build Status">
<img src="https://img.shields.io/github/workflow/status/nerdyman/react-compare-slider/build" alt="Build Status">
</a>
<a href="https://github.com/nerdyman/react-compare-slider/actions?query=workflow%3Abuild">
<img src="https://img.shields.io/codeclimate/coverage/nerdyman/react-compare-slider" alt="Build Status">
</a>
<a href="https://festive-darwin-fab443.netlify.com/">
<img src="https://img.shields.io/badge/demos-🚀-blue.svg" alt="Demos" />
Expand Down

0 comments on commit a9798f5

Please sign in to comment.