Skip to content

Commit 060bd5e

Browse files
Switched from Travis CI to GitHub Actions
1 parent e6b5c26 commit 060bd5e

File tree

3 files changed

+108
-45
lines changed

3 files changed

+108
-45
lines changed

.github/workflows/CI-CD.yaml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# GitHub Actions workflow
2+
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions
3+
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
4+
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions
5+
6+
name: CI-CD
7+
8+
on:
9+
push:
10+
branches:
11+
- "*"
12+
tags-ignore:
13+
- "*"
14+
15+
schedule:
16+
- cron: "0 0 1 * *"
17+
18+
jobs:
19+
test:
20+
name: Node ${{ matrix.node }} on ${{ matrix.os }}
21+
runs-on: ${{ matrix.os }}
22+
timeout-minutes: 10
23+
strategy:
24+
fail-fast: true
25+
matrix:
26+
os:
27+
- ubuntu-latest
28+
- macos-latest
29+
- windows-latest
30+
node:
31+
- 10
32+
- 12
33+
34+
steps:
35+
- name: Checkout source
36+
uses: actions/checkout@v2
37+
38+
- name: Install Node ${{ matrix.node }}
39+
uses: actions/setup-node@v1
40+
with:
41+
node-version: ${{ matrix.node }}
42+
43+
- name: Install dependencies
44+
run: npm ci
45+
46+
- name: Run linter
47+
run: npm run lint
48+
49+
- name: Run tests
50+
run: npm run coverage
51+
52+
- name: Send code coverage results to Coveralls
53+
uses: coverallsapp/[email protected]
54+
with:
55+
github-token: ${{ secrets.GITHUB_TOKEN }}
56+
parallel: true
57+
58+
coverage:
59+
name: Code Coverage
60+
runs-on: ubuntu-latest
61+
timeout-minutes: 10
62+
needs: test
63+
steps:
64+
- name: Let Coveralls know that all tests have finished
65+
uses: coverallsapp/[email protected]
66+
with:
67+
github-token: ${{ secrets.GITHUB_TOKEN }}
68+
parallel-finished: true
69+
70+
deploy:
71+
name: Publish to NPM
72+
if: github.ref == 'refs/heads/master'
73+
runs-on: ubuntu-latest
74+
timeout-minutes: 10
75+
needs: test
76+
77+
steps:
78+
- name: Checkout source
79+
uses: actions/checkout@v2
80+
81+
- name: Install Node
82+
uses: actions/setup-node@v1
83+
84+
- name: Install dependencies
85+
run: npm ci
86+
87+
- name: Build the code
88+
run: npm run build
89+
90+
- name: Publish to NPM
91+
uses: APIDevTools/npm-publish@v1
92+
with:
93+
token: ${{ secrets.NPM_TOKEN }}
94+
95+
- name: Prepare the non-scoped packaged
96+
run: |
97+
cp LICENSE *.md dist
98+
VERSION=$(node -e "console.log(require('./package.json').version)")
99+
sed -i "s/X.X.X/${VERSION}/g" dist/package.json
100+
101+
- name: Publish the non-scoped package to NPM
102+
uses: APIDevTools/npm-publish@v1
103+
with:
104+
token: ${{ secrets.NPM_TOKEN }}
105+
package: dist/package.json

.travis.yml

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

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ Swagger Methods
22
============================
33
#### HTTP methods that are supported by Swagger 2.0
44

5-
[![Cross-Platform Compatibility](https://apitools.dev/img/os-badges.svg)](https://travis-ci.com/APIDevTools/swagger-methods)
6-
[![Build Status](https://api.travis-ci.com/APIDevTools/swagger-methods.svg)](https://travis-ci.com/APIDevTools/swagger-methods)
7-
[![Coverage Status](https://coveralls.io/repos/github/APIDevTools/swagger-methods/badge.svg?branch=master)](https://coveralls.io/github/APIDevTools/swagger-methods?branch=master)
5+
[![Cross-Platform Compatibility](https://apitools.dev/img/badges/os-badges.svg)](https://github.com/APIDevTools/swagger-methods/blob/master/.github/workflows/CI-CD.yaml)
6+
[![Build Status](https://github.com/APIDevTools/swagger-methods/workflows/CI-CD/badge.svg)](https://github.com/APIDevTools/swagger-methods/blob/master/.github/workflows/CI-CD.yaml)
87

98
[![npm](https://img.shields.io/npm/v/swagger-methods.svg?branch=master)](https://www.npmjs.com/package/swagger-methods)
9+
[![Coverage Status](https://coveralls.io/repos/github/APIDevTools/swagger-methods/badge.svg?branch=master)](https://coveralls.io/github/APIDevTools/swagger-methods?branch=master)
1010
[![Dependencies](https://david-dm.org/APIDevTools/swagger-methods.svg)](https://david-dm.org/APIDevTools/swagger-methods)
1111
[![License](https://img.shields.io/npm/l/swagger-methods.svg)](LICENSE)
1212

0 commit comments

Comments
 (0)