|
1 | 1 | name: ci |
2 | 2 |
|
3 | 3 | on: |
4 | | -- pull_request |
5 | | -- push |
| 4 | + - pull_request |
| 5 | + - push |
6 | 6 |
|
7 | 7 | jobs: |
8 | 8 | test: |
9 | 9 | runs-on: ubuntu-latest |
10 | 10 | strategy: |
11 | 11 | fail-fast: false |
12 | 12 | matrix: |
13 | | - name: |
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 | | - |
32 | 13 | include: |
33 | | - - name: Node.js 0.10 |
34 | | - node-version: "0.10" |
35 | | - npm-i: mocha@3.5.3 rimraf@2.7.1 supertest@2.0.0 |
| 14 | + - name: Node.js 0.10 |
| 15 | + node-version: "0.10" |
| 16 | + npm-i: mocha@3.5.3 rimraf@2.7.1 supertest@2.0.0 |
| 17 | + |
| 18 | + - name: Node.js 0.12 |
| 19 | + node-version: "0.12" |
| 20 | + npm-i: mocha@3.5.3 rimraf@2.7.1 supertest@2.0.0 |
| 21 | + |
| 22 | + - name: io.js 1.x |
| 23 | + node-version: "1.8" |
| 24 | + npm-i: mocha@3.5.3 rimraf@2.7.1 supertest@2.0.0 |
| 25 | + |
| 26 | + - name: io.js 2.x |
| 27 | + node-version: "2.5" |
| 28 | + npm-i: mocha@3.5.3 rimraf@2.7.1 supertest@2.0.0 |
36 | 29 |
|
37 | | - - name: Node.js 0.12 |
38 | | - node-version: "0.12" |
39 | | - npm-i: mocha@3.5.3 rimraf@2.7.1 supertest@2.0.0 |
| 30 | + - name: io.js 3.x |
| 31 | + node-version: "3.3" |
| 32 | + npm-i: mocha@3.5.3 rimraf@2.7.1 supertest@2.0.0 |
40 | 33 |
|
41 | | - - name: io.js 1.x |
42 | | - node-version: "1.8" |
43 | | - npm-i: mocha@3.5.3 rimraf@2.7.1 supertest@2.0.0 |
| 34 | + - name: Node.js 4.x |
| 35 | + node-version: "4.9" |
| 36 | + npm-i: mocha@5.2.0 rimraf@2.7.1 supertest@3.4.2 |
44 | 37 |
|
45 | | - - name: io.js 2.x |
46 | | - node-version: "2.5" |
47 | | - npm-i: mocha@3.5.3 rimraf@2.7.1 supertest@2.0.0 |
| 38 | + - name: Node.js 5.x |
| 39 | + node-version: "5.12" |
| 40 | + npm-i: mocha@5.2.0 rimraf@2.7.1 supertest@3.4.2 |
48 | 41 |
|
49 | | - - name: io.js 3.x |
50 | | - node-version: "3.3" |
51 | | - npm-i: mocha@3.5.3 rimraf@2.7.1 supertest@2.0.0 |
| 42 | + - name: Node.js 6.x |
| 43 | + node-version: "6.17" |
| 44 | + npm-i: mocha@6.2.3 |
52 | 45 |
|
53 | | - - name: Node.js 4.x |
54 | | - node-version: "4.9" |
55 | | - npm-i: mocha@5.2.0 rimraf@2.7.1 supertest@3.4.2 |
| 46 | + - name: Node.js 7.x |
| 47 | + node-version: "7.10" |
| 48 | + npm-i: mocha@6.2.3 |
56 | 49 |
|
57 | | - - name: Node.js 5.x |
58 | | - node-version: "5.12" |
59 | | - npm-i: mocha@5.2.0 rimraf@2.7.1 supertest@3.4.2 |
| 50 | + - name: Node.js 8.x |
| 51 | + node-version: "8.17" |
| 52 | + npm-i: mocha@7.2.0 |
60 | 53 |
|
61 | | - - name: Node.js 6.x |
62 | | - node-version: "6.17" |
63 | | - npm-i: mocha@6.2.3 |
| 54 | + - name: Node.js 9.x |
| 55 | + node-version: "9.11" |
| 56 | + npm-i: mocha@7.2.0 |
64 | 57 |
|
65 | | - - name: Node.js 7.x |
66 | | - node-version: "7.10" |
67 | | - npm-i: mocha@6.2.3 |
| 58 | + - name: Node.js 10.x |
| 59 | + node-version: "10.24" |
| 60 | + npm-i: mocha@8.4.0 |
68 | 61 |
|
69 | | - - name: Node.js 8.x |
70 | | - node-version: "8.17" |
71 | | - npm-i: mocha@7.2.0 |
| 62 | + - name: Node.js 11.x |
| 63 | + node-version: "11.15" |
| 64 | + npm-i: mocha@8.4.0 |
72 | 65 |
|
73 | | - - name: Node.js 9.x |
74 | | - node-version: "9.11" |
75 | | - npm-i: mocha@7.2.0 |
| 66 | + - name: Node.js 12.x |
| 67 | + node-version: "12.22" |
76 | 68 |
|
77 | | - - name: Node.js 10.x |
78 | | - node-version: "10.24" |
79 | | - npm-i: mocha@8.4.0 |
| 69 | + - name: Node.js 13.x |
| 70 | + node-version: "13.14" |
80 | 71 |
|
81 | | - - name: Node.js 11.x |
82 | | - node-version: "11.15" |
83 | | - npm-i: mocha@8.4.0 |
| 72 | + - name: Node.js 14.x |
| 73 | + node-version: "14.18" |
84 | 74 |
|
85 | | - - name: Node.js 12.x |
86 | | - node-version: "12.22" |
| 75 | + - name: Node.js 15.x |
| 76 | + node-version: "15.14" |
87 | 77 |
|
88 | | - - name: Node.js 13.x |
89 | | - node-version: "13.14" |
| 78 | + - name: Node.js 16.x |
| 79 | + node-version: "16.19" |
90 | 80 |
|
91 | | - - name: Node.js 14.x |
92 | | - node-version: "14.18" |
| 81 | + - name: Node.js 17.x |
| 82 | + node-version: "17.9" |
93 | 83 |
|
94 | | - - name: Node.js 15.x |
95 | | - node-version: "15.14" |
| 84 | + - name: Node.js 18.x |
| 85 | + node-version: "18.14" |
96 | 86 |
|
97 | 87 | steps: |
98 | | - - uses: actions/checkout@v2 |
99 | | - |
100 | | - - name: Install Node.js ${{ matrix.node-version }} |
101 | | - shell: bash -eo pipefail -l {0} |
102 | | - run: | |
103 | | - nvm install --default ${{ matrix.node-version }} |
104 | | - dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH" |
105 | | -
|
106 | | - - name: Configure npm |
107 | | - run: npm config set shrinkwrap false |
108 | | - |
109 | | - - name: Install npm module(s) ${{ matrix.npm-i }} |
110 | | - run: npm install --save-dev ${{ matrix.npm-i }} |
111 | | - if: matrix.npm-i != '' |
112 | | - |
113 | | - - name: Setup Node.js version-specific dependencies |
114 | | - shell: bash |
115 | | - run: | |
116 | | - # eslint for linting |
117 | | - # - remove on Node.js < 10 |
118 | | - if [[ "$(cut -d. -f1 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then |
119 | | - node -pe 'Object.keys(require("./package").devDependencies).join("\n")' | \ |
120 | | - grep -E '^eslint(-|$)' | \ |
121 | | - sort -r | \ |
122 | | - xargs -n1 npm rm --silent --save-dev |
123 | | - fi |
124 | | -
|
125 | | - - name: Install Node.js dependencies |
126 | | - run: npm install |
127 | | - |
128 | | - - name: List environment |
129 | | - id: list_env |
130 | | - shell: bash |
131 | | - run: | |
132 | | - echo "node@$(node -v)" |
133 | | - echo "npm@$(npm -v)" |
134 | | - npm -s ls ||: |
135 | | - (npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print "::set-output name=" $2 "::" $3 }' |
136 | | -
|
137 | | - - name: Run tests |
138 | | - run: npm run test-ci |
139 | | - |
140 | | - - name: Lint code |
141 | | - if: steps.list_env.outputs.eslint != '' |
142 | | - run: npm run lint |
| 88 | + - uses: actions/checkout@v3 |
| 89 | + |
| 90 | + - name: Install Python 2.x |
| 91 | + uses: actions/setup-python@v4 |
| 92 | + with: |
| 93 | + python-version: "2.x" |
| 94 | + |
| 95 | + - name: Install Node.js ${{ matrix.node-version }} |
| 96 | + uses: actions/setup-node@v3 |
| 97 | + with: |
| 98 | + node-version: ${{ matrix.node-version }} |
| 99 | + |
| 100 | + - name: Configure npm |
| 101 | + run: npm config set shrinkwrap false |
| 102 | + |
| 103 | + - name: Install npm module(s) ${{ matrix.npm-i }} |
| 104 | + run: npm install --save-dev ${{ matrix.npm-i }} |
| 105 | + if: matrix.npm-i != '' |
| 106 | + |
| 107 | + - name: Setup Node.js version-specific dependencies |
| 108 | + shell: bash |
| 109 | + run: | |
| 110 | + # eslint for linting |
| 111 | + # - remove on Node.js < 10 |
| 112 | + if [[ "$(cut -d. -f1 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then |
| 113 | + node -pe 'Object.keys(require("./package").devDependencies).join("\n")' | \ |
| 114 | + grep -E '^eslint(-|$)' | \ |
| 115 | + sort -r | \ |
| 116 | + xargs -n1 npm rm --silent --save-dev |
| 117 | + fi |
| 118 | +
|
| 119 | + - name: Install Node.js dependencies |
| 120 | + run: npm ci |
| 121 | + |
| 122 | + - name: List environment |
| 123 | + id: list_env |
| 124 | + shell: bash |
| 125 | + run: | |
| 126 | + echo "node@$(node -v)" |
| 127 | + echo "npm@$(npm -v)" |
| 128 | + npm -s ls ||: |
| 129 | + (npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print "::set-output name=" $2 "::" $3 }' |
| 130 | +
|
| 131 | + - name: Run tests |
| 132 | + run: npm run test-ci |
| 133 | + |
| 134 | + - name: Lint code |
| 135 | + if: steps.list_env.outputs.eslint != '' |
| 136 | + run: npm run lint |
0 commit comments