Skip to content

Commit

Permalink
build(github): add coveralls to the github ci && add npm release script
Browse files Browse the repository at this point in the history
  • Loading branch information
ruscon committed Nov 22, 2019
1 parent be5dde9 commit 5a85d8a
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 44 deletions.
67 changes: 32 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,68 +12,65 @@ on:
jobs:
commitlint:
runs-on: ubuntu-latest

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v1
- name: Clone repository
uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: wagoid/[email protected]

- name: Lints Pull Request commits
uses: wagoid/[email protected]

build:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [8.x, 10.x, 12.x, 13.x]
node-version: [8.x, 10.x, 12.x]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v1
- name: Clone repository
uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, lint and coverage
run: |
npm i
npm run lint
npm run coverage:all

- run: node --version
- run: npm --version

- name: Install npm dependencies
run: npm i

- name: Lint code
run: npm run lint

- name: Run tests
run: npm run coverage:all
env:
GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }}
MAP_QUEST_API_KEY: ${{ secrets.MAP_QUEST_API_KEY }}
HERE_APP_ID: ${{ secrets.HERE_APP_ID }}
HERE_APP_CODE: ${{ secrets.HERE_APP_CODE }}

# coveralls:
# needs: [build]
# runs-on: ubuntu-latest
# steps:
# - name: Run coveralls
# run: npm i coveralls && npm run coveralls
## - name: Run coveralls
## uses: coverallsapp/github-action@master
## with:
## github-token: ${{ secrets.GITHUB_TOKEN }}

# coveralls:
# needs: [build]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v1
# with:
# fetch-depth: 1
# - uses: actions/setup-node@v1
# with:
# node-version: '12.x'
# - name: Run coveralls
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Coveralls
uses: coverallsapp/github-action@master
if: startsWith(matrix.node-version, '12.')
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

# publish:
## needs: [commitlint, build, coveralls]
# needs: [commitlint, build]
# runs-on: ubuntu-latest
# steps:
Expand Down
2 changes: 1 addition & 1 deletion .nycrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"src/provider/map-quest/command/map-quest-suggest.command.ts",
"src/model/abstract-provider.ts"
],
"reporter": ["text-summary", "html"],
"reporter": ["lcov", "text-summary", "html"],
"cache": false,
"all": true
}
31 changes: 31 additions & 0 deletions .versionrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "test",
"section": "Tests",
"hidden": true
},
{
"type": "build",
"section": "Build System",
"hidden": true
},
{
"type": "chore",
"section": "Chore",
"hidden": true
},
{
"type": "ci",
"hidden": true
}
]
}
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[![Build Status](https://github.com/goparrot/geocoder/workflows/CI/badge.svg?branch=master)](https://github.com/goparrot/geocoder/actions?query=branch%3Amaster+event%3Apush+workflow%3ACI)
[![Coverage Status](https://coveralls.io/repos/github/goparrot/geocoder/badge.svg?branch=master)](https://coveralls.io/github/goparrot/geocoder?branch=master)
[![npm version](https://badge.fury.io/js/%40goparrot%2Fgeocoder.svg)](https://badge.fury.io/js/%40goparrot%2Fgeocoder)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) [![Greenkeeper badge](https://badges.greenkeeper.io/goparrot/geocoder.svg)](https://greenkeeper.io/)
[![NPM version](https://img.shields.io/npm/v/@goparrot/geocoder)](https://www.npmjs.com/package/@goparrot/geocoder)
[![Greenkeeper badge](https://badges.greenkeeper.io/goparrot/geocoder.svg)](https://greenkeeper.io/)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)

# Geocoder

Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"coverage:fast": "TS_NODE_TRANSPILE_ONLY=true nyc npm run test:fast",
"coverage:all": "nyc npm run test:all",
"coverage:all:fast": "TS_NODE_TRANSPILE_ONLY=true nyc npm run test:all:fast",
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"format": "prettier \"**/*.{ts,js,json}\" --write",
"format:staged": "lint-staged",
"lint": "npm run lint:config:check && tslint -c tslint.json -p tsconfig.json --format stylish",
Expand All @@ -78,9 +77,10 @@
"publish": "npm run build && node bin/prepublish.js && npm publish dist",
"publish:dev": "npm run publish --tag dev",
"publish:dev:dry": "npm run publish:dev --dry-run",
"preversion": "npm run pre-commit",
"version": "npm run changelog",
"postversion": "git push && git push --tags"
"version": "echo \"use 'npm run release'\" && exit 1",
"release": "standard-version && git push && git push --tags && npm run publish && npm run github-release",
"release:dry": "npm run publish:dev:dry && standard-version --dry-run",
"github-release": "conventional-github-releaser -p angular"
},
"peerDependencies": {
"axios": ">=0.18",
Expand Down Expand Up @@ -111,8 +111,8 @@
"class-transformer": "^0.2.3",
"class-validator": "^0.10.0",
"commitizen": "^4.0.0",
"conventional-changelog-cli": "^2.0.25",
"coveralls": "^3.0.7",
"conventional-changelog-cli": "^2.0.27",
"conventional-github-releaser": "^3.1.3",
"cz-conventional-changelog": "^3.0.2",
"dotenv": "^8.2.0",
"husky": "^3.0.9",
Expand All @@ -130,6 +130,7 @@
"rimraf": "^3.0.0",
"sinon": "^7.5.0",
"source-map-support": "^0.5.16",
"standard-version": "^7.0.0",
"supertest": "^4.0.2",
"ts-node": "^8.4.1",
"tsconfig-paths": "^3.9.0",
Expand Down

0 comments on commit 5a85d8a

Please sign in to comment.