Skip to content

Commit

Permalink
ci(github-actions): ci.yml (#587)
Browse files Browse the repository at this point in the history
  • Loading branch information
chimurai authored May 3, 2021
1 parent 9d5a4fd commit ab944a8
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 65 deletions.
97 changes: 97 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: CI

on: ['push', 'pull_request']

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16.x

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: yarn install
if: steps.yarn-cache.outputs.cache-hit != 'true' # Over here!
run: yarn install --frozen-lockfile

- name: yarn lint
run: yarn lint

env:
CI: true

test:
name: Test
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: yarn install
if: steps.yarn-cache.outputs.cache-hit != 'true' # Over here!
run: yarn install --frozen-lockfile

- name: yarn test
run: yarn test

env:
CI: true

coverage:
name: Coverage
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16.x

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: yarn install
if: steps.yarn-cache.outputs.cache-hit != 'true' # Over here!
run: yarn install --frozen-lockfile

- name: yarn coverage
run: yarn coverage

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
25 changes: 0 additions & 25 deletions .github/workflows/coveralls.yml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/lint.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/test.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# http-proxy-middleware

[![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)
[![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)
[![Coveralls](https://img.shields.io/coveralls/chimurai/http-proxy-middleware.svg?style=flat-square)](https://coveralls.io/r/chimurai/http-proxy-middleware)
[![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)
[![dependency Status](https://snyk.io/test/npm/http-proxy-middleware/badge.svg?style=flat-square)](https://snyk.io/test/npm/http-proxy-middleware)
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"build": "tsc",
"pretest": "yarn build",
"test": "jest",
"precoverage": "yarn build",
"coverage": "jest --coverage --coverageReporters=lcov",
"prepare": "yarn build && rm dist/tsconfig.tsbuildinfo"
},
Expand Down

0 comments on commit ab944a8

Please sign in to comment.