Skip to content

Commit ab944a8

Browse files
authored
ci(github-actions): ci.yml (#587)
1 parent 9d5a4fd commit ab944a8

File tree

6 files changed

+99
-65
lines changed

6 files changed

+99
-65
lines changed

.github/workflows/ci.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: CI
2+
3+
on: ['push', 'pull_request']
4+
5+
jobs:
6+
lint:
7+
name: Lint
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Use Node.js 16.x
13+
uses: actions/setup-node@v2
14+
with:
15+
node-version: 16.x
16+
17+
- uses: actions/cache@v2
18+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
19+
with:
20+
path: '**/node_modules'
21+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
22+
restore-keys: |
23+
${{ runner.os }}-yarn-
24+
25+
- name: yarn install
26+
if: steps.yarn-cache.outputs.cache-hit != 'true' # Over here!
27+
run: yarn install --frozen-lockfile
28+
29+
- name: yarn lint
30+
run: yarn lint
31+
32+
env:
33+
CI: true
34+
35+
test:
36+
name: Test
37+
runs-on: ubuntu-latest
38+
39+
strategy:
40+
matrix:
41+
node-version: [12.x, 14.x, 16.x]
42+
43+
steps:
44+
- uses: actions/checkout@v2
45+
- name: Use Node.js ${{ matrix.node-version }}
46+
uses: actions/setup-node@v2
47+
with:
48+
node-version: ${{ matrix.node-version }}
49+
50+
- uses: actions/cache@v2
51+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
52+
with:
53+
path: '**/node_modules'
54+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
55+
restore-keys: |
56+
${{ runner.os }}-yarn-
57+
58+
- name: yarn install
59+
if: steps.yarn-cache.outputs.cache-hit != 'true' # Over here!
60+
run: yarn install --frozen-lockfile
61+
62+
- name: yarn test
63+
run: yarn test
64+
65+
env:
66+
CI: true
67+
68+
coverage:
69+
name: Coverage
70+
runs-on: ubuntu-latest
71+
72+
steps:
73+
- uses: actions/checkout@v2
74+
- name: Use Node.js 16.x
75+
uses: actions/setup-node@v2
76+
with:
77+
node-version: 16.x
78+
79+
- uses: actions/cache@v2
80+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
81+
with:
82+
path: '**/node_modules'
83+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
84+
restore-keys: |
85+
${{ runner.os }}-yarn-
86+
87+
- name: yarn install
88+
if: steps.yarn-cache.outputs.cache-hit != 'true' # Over here!
89+
run: yarn install --frozen-lockfile
90+
91+
- name: yarn coverage
92+
run: yarn coverage
93+
94+
- name: Coveralls
95+
uses: coverallsapp/github-action@master
96+
with:
97+
github-token: ${{ secrets.github_token }}

.github/workflows/coveralls.yml

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

.github/workflows/lint.yml

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

.github/workflows/test.yml

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# http-proxy-middleware
22

3-
[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/chimurai/http-proxy-middleware/Test/master?style=flat-square)](https://github.com/chimurai/http-proxy-middleware/actions?query=branch%3Amaster)
3+
[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/chimurai/http-proxy-middleware/CI/master?style=flat-square)](https://github.com/chimurai/http-proxy-middleware/actions?query=branch%3Amaster)
44
[![Coveralls](https://img.shields.io/coveralls/chimurai/http-proxy-middleware.svg?style=flat-square)](https://coveralls.io/r/chimurai/http-proxy-middleware)
55
[![dependency Status](https://img.shields.io/david/chimurai/http-proxy-middleware.svg?style=flat-square)](https://david-dm.org/chimurai/http-proxy-middleware#info=dependencies)
66
[![dependency Status](https://snyk.io/test/npm/http-proxy-middleware/badge.svg?style=flat-square)](https://snyk.io/test/npm/http-proxy-middleware)

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"build": "tsc",
2020
"pretest": "yarn build",
2121
"test": "jest",
22+
"precoverage": "yarn build",
2223
"coverage": "jest --coverage --coverageReporters=lcov",
2324
"prepare": "yarn build && rm dist/tsconfig.tsbuildinfo"
2425
},

0 commit comments

Comments
 (0)