|
4 | 4 |
|
5 | 5 | jobs: |
6 | 6 | # runs on branch pushes only |
7 | | - ci: |
8 | | - name: Run Tests |
| 7 | + ci_unuit: |
| 8 | + name: Run Unit Tests |
9 | 9 | if: startsWith(github.ref, 'refs/heads') |
10 | | - runs-on: ubuntu-18.04 |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - name: Checkout |
| 13 | + uses: actions/checkout@v2 |
| 14 | + - name: Setup Node.js |
| 15 | + uses: actions/setup-node@v1 |
| 16 | + with: |
| 17 | + node-version: 16 |
| 18 | + - name: Install dependencies |
| 19 | + run: npm ci |
| 20 | + - name: Run Unit Tests |
| 21 | + run: npm test |
| 22 | + - uses: codecov/codecov-action@v3 |
| 23 | + with: |
| 24 | + directory: ./coverage/ |
| 25 | + verbose: true |
| 26 | + |
| 27 | + ci_integration: |
| 28 | + name: Run Integration Tests |
| 29 | + if: startsWith(github.ref, 'refs/heads') |
| 30 | + runs-on: ubuntu-latest |
11 | 31 | steps: |
12 | 32 | - name: Checkout |
13 | 33 | uses: actions/checkout@v2 |
@@ -220,7 +240,39 @@ jobs: |
220 | 240 | expected: 2 |
221 | 241 | actual: ${{ steps.retry_on_error.outputs.exit_code }} |
222 | 242 |
|
223 | | - # timeout tests (takes longer to run so run last) |
| 243 | + - name: sad-path (wrong shell for OS) |
| 244 | + id: wrong_shell |
| 245 | + uses: ./ |
| 246 | + continue-on-error: true |
| 247 | + with: |
| 248 | + timeout_minutes: 1 |
| 249 | + max_attempts: 2 |
| 250 | + shell: cmd |
| 251 | + command: 'dir' |
| 252 | + - uses: nick-invision/assert-action@v1 |
| 253 | + with: |
| 254 | + expected: 2 |
| 255 | + actual: ${{ steps.wrong_shell.outputs.total_attempts }} |
| 256 | + - uses: nick-invision/assert-action@v1 |
| 257 | + with: |
| 258 | + expected: failure |
| 259 | + actual: ${{ steps.wrong_shell.outcome }} |
| 260 | + |
| 261 | + # timeout tests take longer to run so run in parallel |
| 262 | + ci_integration_timeout: |
| 263 | + name: Run Integration Timeout Tests |
| 264 | + if: startsWith(github.ref, 'refs/heads') |
| 265 | + runs-on: ubuntu-latest |
| 266 | + steps: |
| 267 | + - name: Checkout |
| 268 | + uses: actions/checkout@v2 |
| 269 | + - name: Setup Node.js |
| 270 | + uses: actions/setup-node@v1 |
| 271 | + with: |
| 272 | + node-version: 16 |
| 273 | + - name: Install dependencies |
| 274 | + run: npm ci |
| 275 | + |
224 | 276 | - name: sad-path (timeout) |
225 | 277 | id: sad_path_timeout |
226 | 278 | uses: ./ |
@@ -295,24 +347,6 @@ jobs: |
295 | 347 | expected: failure |
296 | 348 | actual: ${{ steps.sad_path_timeout.outcome }} |
297 | 349 |
|
298 | | - - name: sad-path (wrong shell for OS) |
299 | | - id: wrong_shell |
300 | | - uses: ./ |
301 | | - continue-on-error: true |
302 | | - with: |
303 | | - timeout_minutes: 1 |
304 | | - max_attempts: 2 |
305 | | - shell: cmd |
306 | | - command: 'dir' |
307 | | - - uses: nick-invision/assert-action@v1 |
308 | | - with: |
309 | | - expected: 2 |
310 | | - actual: ${{ steps.wrong_shell.outputs.total_attempts }} |
311 | | - - uses: nick-invision/assert-action@v1 |
312 | | - with: |
313 | | - expected: failure |
314 | | - actual: ${{ steps.wrong_shell.outcome }} |
315 | | - |
316 | 350 | ci_windows: |
317 | 351 | name: Run Windows Tests |
318 | 352 | if: startsWith(github.ref, 'refs/heads') |
@@ -368,9 +402,9 @@ jobs: |
368 | 402 | # runs on push to master only |
369 | 403 | cd: |
370 | 404 | name: Publish Action |
371 | | - needs: ci |
| 405 | + needs: [ci_integration, ci_integration_timeout, ci_windows] |
372 | 406 | if: github.ref == 'refs/heads/master' |
373 | | - runs-on: ubuntu-18.04 |
| 407 | + runs-on: ubuntu-latest |
374 | 408 | steps: |
375 | 409 | - name: Checkout |
376 | 410 | uses: actions/checkout@v2 |
|
0 commit comments