Skip to content

Commit 0ec6742

Browse files
Merge branch 'master' into master
2 parents e87ca6b + b5398f0 commit 0ec6742

File tree

5 files changed

+191
-119
lines changed

5 files changed

+191
-119
lines changed

.github/workflows/ci.yml

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
name: ci
2+
3+
on:
4+
- pull_request
5+
- push
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
name:
13+
- Node.js 0.8
14+
- Node.js 0.10
15+
- Node.js 0.12
16+
- io.js 1.x
17+
- io.js 2.x
18+
- io.js 3.x
19+
- Node.js 4.x
20+
- Node.js 5.x
21+
- Node.js 6.x
22+
- Node.js 7.x
23+
- Node.js 8.x
24+
- Node.js 9.x
25+
- Node.js 10.x
26+
- Node.js 11.x
27+
- Node.js 12.x
28+
- Node.js 13.x
29+
- Node.js 14.x
30+
- Node.js 15.x
31+
- Node.js 16.x
32+
33+
include:
34+
- name: Node.js 0.8
35+
node-version: "0.8"
36+
37+
npm-rm: istanbul
38+
39+
- name: Node.js 0.10
40+
node-version: "0.10"
41+
42+
43+
- name: Node.js 0.12
44+
node-version: "0.12"
45+
46+
47+
- name: io.js 1.x
48+
node-version: "1.8"
49+
50+
51+
- name: io.js 2.x
52+
node-version: "2.5"
53+
54+
55+
- name: io.js 3.x
56+
node-version: "3.3"
57+
58+
59+
- name: Node.js 4.x
60+
node-version: "4.9"
61+
62+
63+
- name: Node.js 5.x
64+
node-version: "5.12"
65+
66+
67+
- name: Node.js 6.x
68+
node-version: "6.17"
69+
70+
- name: Node.js 7.x
71+
node-version: "7.10"
72+
73+
- name: Node.js 8.x
74+
node-version: "8.16"
75+
76+
- name: Node.js 9.x
77+
node-version: "9.11"
78+
79+
- name: Node.js 10.x
80+
node-version: "10.16"
81+
82+
- name: Node.js 11.x
83+
node-version: "11.15"
84+
85+
- name: Node.js 12.x
86+
node-version: "12.22"
87+
88+
- name: Node.js 13.x
89+
node-version: "13.13"
90+
91+
- name: Node.js 14.x
92+
node-version: "14.18"
93+
94+
- name: Node.js 15.x
95+
node-version: "15.14"
96+
97+
- name: Node.js 16.x
98+
node-version: "16.13"
99+
100+
steps:
101+
- uses: actions/checkout@v2
102+
103+
- name: Install Node.js ${{ matrix.node-version }}
104+
shell: bash -eo pipefail -l {0}
105+
run: |
106+
nvm install --default ${{ matrix.node-version }}
107+
if [[ "${{ matrix.node-version }}" == 0.* && "$(cut -d. -f2 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then
108+
nvm install --alias=npm 0.10
109+
nvm use ${{ matrix.node-version }}
110+
sed -i '1s;^.*$;'"$(printf '#!%q' "$(nvm which npm)")"';' "$(readlink -f "$(which npm)")"
111+
npm config set strict-ssl false
112+
fi
113+
dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH"
114+
115+
- name: Configure npm
116+
run: npm config set shrinkwrap false
117+
118+
- name: Remove npm module(s) ${{ matrix.npm-rm }}
119+
run: npm rm --silent --save-dev ${{ matrix.npm-rm }}
120+
if: matrix.npm-rm != ''
121+
122+
- name: Install npm module(s) ${{ matrix.npm-i }}
123+
run: npm install --save-dev ${{ matrix.npm-i }}
124+
if: matrix.npm-i != ''
125+
126+
- name: Setup Node.js version-specific dependencies
127+
shell: bash
128+
run: |
129+
# eslint for linting
130+
# - remove on Node.js < 10
131+
if [[ "$(cut -d. -f1 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then
132+
node -pe 'Object.keys(require("./package").devDependencies).join("\n")' | \
133+
grep -E '^eslint(-|$)' | \
134+
sort -r | \
135+
xargs -n1 npm rm --silent --save-dev
136+
fi
137+
138+
- name: Install Node.js dependencies
139+
run: npm install
140+
141+
- name: List environment
142+
id: list_env
143+
shell: bash
144+
run: |
145+
echo "node@$(node -v)"
146+
echo "npm@$(npm -v)"
147+
npm -s ls ||:
148+
(npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print "::set-output name=" $2 "::" $3 }'
149+
150+
- name: Run tests
151+
shell: bash
152+
run: |
153+
if npm -ps ls istanbul | grep -q istanbul; then
154+
npm run test-ci
155+
else
156+
npm test
157+
fi
158+
159+
- name: Lint code
160+
if: steps.list_env.outputs.eslint != ''
161+
run: npm run lint
162+
163+
- name: Collect code coverage
164+
uses: coverallsapp/github-action@master
165+
if: steps.list_env.outputs.istanbul != ''
166+
with:
167+
github-token: ${{ secrets.GITHUB_TOKEN }}
168+
flag-name: run-${{ matrix.test_number }}
169+
parallel: true
170+
171+
coverage:
172+
needs: test
173+
runs-on: ubuntu-latest
174+
steps:
175+
- name: Uploade code coverage
176+
uses: coverallsapp/github-action@master
177+
with:
178+
github-token: ${{ secrets.github_token }}
179+
parallel-finished: true

.travis.yml

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

HISTORY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ unreleased
77
88
* deps: compressible@~2.0.17
99
- deps: mime-db@'>= 1.40.0 < 2'
10-
10+
1111

1212
1.7.4 / 2019-03-18
1313
==================

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![NPM Version][npm-image]][npm-url]
44
[![NPM Downloads][downloads-image]][downloads-url]
5-
[![Build Status][travis-image]][travis-url]
5+
[![Build Status][github-actions-ci-image]][github-actions-ci-url]
66
[![Test Coverage][coveralls-image]][coveralls-url]
77

88
Node.js compression middleware.
@@ -232,9 +232,9 @@ app.get('/events', function (req, res) {
232232

233233
[npm-image]: https://img.shields.io/npm/v/compression.svg
234234
[npm-url]: https://npmjs.org/package/compression
235-
[travis-image]: https://img.shields.io/travis/expressjs/compression/master.svg
236-
[travis-url]: https://travis-ci.org/expressjs/compression
237235
[coveralls-image]: https://img.shields.io/coveralls/expressjs/compression/master.svg
238236
[coveralls-url]: https://coveralls.io/r/expressjs/compression?branch=master
239237
[downloads-image]: https://img.shields.io/npm/dm/compression.svg
240238
[downloads-url]: https://npmjs.org/package/compression
239+
[github-actions-ci-image]: https://badgen.net/github/checks/expressjs/compression/master?label=ci
240+
[github-actions-ci-url]: https://github.com/expressjs/compression/actions?query=workflow%3Aci

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@
1515
"compressible": "~2.0.17",
1616
"debug": "2.6.9",
1717
"on-headers": "~1.0.2",
18-
"safe-buffer": "5.2.0",
18+
"safe-buffer": "5.2.1",
1919
"vary": "~1.1.2"
2020
},
2121
"devDependencies": {
2222
"after": "0.8.2",
23-
"eslint": "6.3.0",
24-
"eslint-config-standard": "14.0.1",
25-
"eslint-plugin-import": "2.18.2",
23+
"eslint": "7.32.0",
24+
"eslint-config-standard": "14.1.1",
25+
"eslint-plugin-import": "2.25.3",
2626
"eslint-plugin-markdown": "1.0.0",
2727
"eslint-plugin-node": "9.2.0",
2828
"eslint-plugin-promise": "4.2.1",
2929
"eslint-plugin-standard": "4.0.1",
3030
"istanbul": "0.4.5",
31-
"mocha": "6.2.0",
32-
"supertest": "4.0.2",
31+
"mocha": "6.2.3",
32+
"supertest": "4.0.2"
3333
"sinon": "^4.0.0"
3434
},
3535
"files": [
@@ -43,7 +43,7 @@
4343
"scripts": {
4444
"lint": "eslint --plugin markdown --ext js,md .",
4545
"test": "mocha --check-leaks --reporter spec --bail",
46-
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot",
47-
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec"
46+
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec",
47+
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot"
4848
}
4949
}

0 commit comments

Comments
 (0)