Skip to content

Commit 8cb7397

Browse files
authored
ci: move to github workflow (#159)
* ci: move to github workflow * doc: add workflow badge
1 parent 065d70d commit 8cb7397

3 files changed

Lines changed: 62 additions & 53 deletions

File tree

.circleci/config.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: CI
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
lockfile-lint:
7+
name: Lockfile lint
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-node@v2
12+
with:
13+
node-version: '14'
14+
- name: lint lock file
15+
run: npx lockfile-lint --path package-lock.json --allowed-hosts npm --validate-https
16+
17+
test:
18+
strategy:
19+
matrix:
20+
platform: [ ubuntu-latest ]
21+
node: [ '10', '12', '14', '16' ]
22+
needs: lockfile-lint
23+
name: Unit Tests Node ${{ matrix.node }} (${{ matrix.platform }})
24+
runs-on: ${{ matrix.platform }}
25+
steps:
26+
- uses: actions/checkout@v2
27+
- uses: actions/setup-node@v2
28+
with:
29+
node-version: ${{ matrix.node }}
30+
- uses: actions/cache@v2
31+
with:
32+
path: '**/node_modules'
33+
key: ${{ matrix.node }}-node-${{ hashFiles('**/package-lock.json') }}
34+
- name: install dependencies
35+
if: steps.cache.outputs.cache-hit != 'true'
36+
run: npm ci
37+
- name: Units Tests + Prepare Coveralls
38+
run: npm run test:ci
39+
- name: Coveralls
40+
uses: coverallsapp/github-action@master
41+
if: matrix.node == '14'
42+
with:
43+
github-token: ${{ secrets.GITHUB_TOKEN }}
44+
45+
release:
46+
name: release
47+
needs: [ test, lockfile-lint ]
48+
runs-on: 'ubuntu-latest'
49+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
50+
steps:
51+
- uses: actions/checkout@v2
52+
- uses: actions/setup-node@v2
53+
with:
54+
node-version: '14'
55+
- name: install dependencies
56+
run: npm ci --ignore-scripts
57+
- name: release
58+
run: npx semantic-release
59+
env:
60+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
61+
NPM_TOKEN: ${{secrets.NPM_TOKEN}}

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# openapi-validator-middleware
22

33
[![NPM Version][npm-image]][npm-url]
4+
![main workflow](https://github.com/PayU/openapi-validator-middleware/actions/workflows/main.yml/badge.svg)
45
[![NPM Downloads][downloads-image]][downloads-url]
5-
[![Build Status][circleci-image]][circleci-url]
66
[![Test Coverage][coveralls-image]][coveralls-url]
77
[![Known Vulnerabilities][snyk-image]][snyk-url]
88
[![Apache 2.0 License][license-image]][license-url]
@@ -260,8 +260,6 @@ npm test
260260

261261
[npm-image]: https://img.shields.io/npm/v/openapi-validator-middleware.svg?style=flat
262262
[npm-url]: https://npmjs.org/package/openapi-validator-middleware
263-
[circleci-image]: https://circleci.com/gh/PayU/openapi-validator-middleware.svg?style=svg
264-
[circleci-url]: https://circleci.com/gh/PayU/openapi-validator-middleware
265263
[coveralls-image]: https://coveralls.io/repos/github/PayU/openapi-validator-middleware/badge.svg?branch=master
266264
[coveralls-url]: https://coveralls.io/github/PayU/openapi-validator-middleware?branch=master
267265
[downloads-image]: http://img.shields.io/npm/dm/openapi-validator-middleware.svg?style=flat

0 commit comments

Comments
 (0)