Skip to content

Commit

Permalink
move to gh action and codeclimate
Browse files Browse the repository at this point in the history
  • Loading branch information
iamolegga committed Aug 28, 2021
1 parent d1a4ff8 commit 75cef5e
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 707 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: build-and-package-alpha

on:
push:
branches:
- "**/*"

jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]

- name: Fetch tags
run: git fetch --prune --unshallow --tags

- uses: actions/setup-node@v2
with:
node-version: '12.x'
registry-url: 'https://registry.npmjs.org'

- name: Install npm v7
run: npm i -g npm@7

- name: Install deps
run: npm ci

- name: Build
run: npm run build

- name: Lint
run: npm run lint

- name: Test
run: npm t

- name: publish code coverage
uses: paambaati/[email protected]
if: ${{ github.ref == 'refs/heads/master' }}
with:
coverageLocations: |
${{github.workspace}}/coverage/lcov.info:lcov
env:
CC_TEST_REPORTER_ID: ${{ secrets.CODE_CLIMATE_REPORTER_ID }}

- name: Set version
run: |
npm version --no-git-tag-version $(git describe --abbrev=0 --tags)-alpha.$(git rev-parse --short=6 ${{ github.sha }})
- run: npm publish --tag alpha
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
15 changes: 15 additions & 0 deletions .github/workflows/pr-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: coverage

on:
pull_request:
branches:
- master
jobs:
coverage:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: artiomtr/[email protected]
with:
github-token: ${{ secrets.GH_TOKEN }}
47 changes: 47 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: release

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Fetch tags
run: git fetch --prune --unshallow --tags

- uses: actions/setup-node@v2
with:
node-version: '12.x'
registry-url: 'https://registry.npmjs.org'

- name: Install npm v7
run: npm i -g npm@7

- name: Install deps
run: npm ci

- name: Build
run: npm run build

- name: Set version
run: |
npm version --no-git-tag-version $(git describe --abbrev=0 --tags)
- name: Commit version change
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "update version" -a
- name: Push
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GH_TOKEN }}

- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
<a href="https://www.npmjs.com/package/nestjs-pino">
<img alt="npm" src="https://img.shields.io/npm/v/nestjs-pino" />
</a>
<a href="https://travis-ci.org/iamolegga/nestjs-pino">
<img alt="Travis (.org)" src="https://img.shields.io/travis/iamolegga/nestjs-pino" />
</a>
<a href="https://coveralls.io/github/iamolegga/nestjs-pino?branch=master">
<img alt="Coverage Status" src="https://coveralls.io/repos/github/iamolegga/nestjs-pino/badge.svg?branch=master" />
<img alt="GitHub branch checks state" src="https://img.shields.io/github/checks-status/iamolegga/nestjs-pino/master">
<a href="https://codeclimate.com/github/iamolegga/nestjs-pino/test_coverage">
<img src="https://api.codeclimate.com/v1/badges/2821150bb93506cb66fc/test_coverage" />
</a>
<a href="https://snyk.io/test/github/iamolegga/nestjs-pino">
<img alt="Snyk Vulnerabilities for npm package" src="https://img.shields.io/snyk/vulnerabilities/npm/nestjs-pino" />
Expand Down
Loading

0 comments on commit 75cef5e

Please sign in to comment.