Skip to content

Commit 9b5cbec

Browse files
authored
ci: optimize speed of CI (#7649)
Refs #7627
1 parent 0e5bc25 commit 9b5cbec

7 files changed

+511
-118
lines changed

.github/workflows/dependabot-merge.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,7 @@ jobs:
99
if: github.actor == 'dependabot[bot]'
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: 'Wait for status checks'
13-
id: waitforstatuschecks
14-
uses: WyriHaximus/github-action-wait-for-status@v1
15-
with:
16-
ignoreActions: Merge me!
17-
checkInterval: 180
18-
env:
19-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2012
- name: Merge me!
21-
if: steps.waitforstatuschecks.outputs.status == 'success'
2213
uses: ahmadnassri/action-dependabot-auto-merge@v2
2314
with:
2415
target: minor

.github/workflows/nodejs.yml

Lines changed: 59 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -16,73 +16,69 @@ jobs:
1616
build:
1717
runs-on: ubuntu-latest
1818

19-
strategy:
20-
matrix:
21-
node-version: [12.x, 14.x, 16.8]
22-
2319
steps:
24-
- uses: actions/checkout@v2
25-
- name: Use Node.js ${{ matrix.node-version }}
26-
uses: actions/setup-node@v2
27-
with:
28-
node-version: ${{ matrix.node-version }}
29-
- name: Cache Node Modules
30-
id: cache-node-modules
31-
uses: actions/cache@v2
32-
with:
33-
path: node_modules
34-
key: node-modules-${{ hashFiles('package-lock.json') }}
35-
- name: Cache Cypress binary
36-
id: cache-cypress-binary
37-
uses: actions/cache@v2
38-
with:
39-
path: cypress/cache
40-
key: cypress-binary-${{ hashFiles('package-lock.json') }}
41-
- name: Install dependencies
42-
if: |
43-
steps.cache-node-modules.outputs.cache-hit != 'true' ||
44-
steps.cache-cypress-binary.outputs.cache-hit != 'true'
45-
run: npm ci
46-
- name: Lint code for errors only
47-
run: npm run lint-errors
48-
- name: Run all tests
49-
run: npm test
50-
env:
51-
CI: true
20+
- uses: actions/checkout@v2
21+
- name: Use Node.js 16.x
22+
uses: actions/setup-node@v2
23+
with:
24+
node-version: 16
25+
- name: Cache Node Modules
26+
id: cache-node-modules
27+
uses: actions/cache@v2
28+
with:
29+
path: node_modules
30+
key: node-modules-${{ hashFiles('package-lock.json') }}
31+
- name: Cache Cypress binary
32+
id: cache-cypress-binary
33+
uses: actions/cache@v2
34+
with:
35+
path: cypress/cache
36+
key: cypress-binary-${{ hashFiles('package-lock.json') }}
37+
- name: Install dependencies
38+
if: |
39+
steps.cache-node-modules.outputs.cache-hit != 'true' ||
40+
steps.cache-cypress-binary.outputs.cache-hit != 'true'
41+
run: npm ci
42+
- name: Lint code for errors only
43+
run: npm run lint-errors
44+
- name: Run all tests
45+
run: npm run just-test-in-node && npm run test:unit-jest
46+
env:
47+
CI: true
48+
- name: Build SwaggerUI
49+
run: npm run build
50+
- name: Test build artifacts
51+
run: npm run test:artifact
5252

53-
artifact-bundle:
53+
e2e-tests:
5454
runs-on: ubuntu-latest
55-
5655
strategy:
56+
fail-fast: false
5757
matrix:
58-
node-version: [12.x, 14.x, 16.x]
59-
60-
steps:
61-
- uses: actions/checkout@v2
62-
- name: Use Node.js ${{ matrix.node-version }}
63-
uses: actions/setup-node@v2
64-
with:
65-
node-version: ${{ matrix.node-version }}
66-
- name: Cache Node Modules # artifact-bundle test is node-only, no Cypress
67-
id: cache-node-modules
68-
uses: actions/cache@v2
69-
with:
70-
path: node_modules
71-
key: node-modules-${{ hashFiles('package-lock.json') }}
72-
- name: Install dependencies
73-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
74-
run: npm ci
75-
- name: Build and Run all artifact tests
76-
run: npm run test:artifact
77-
78-
release:
79-
if: contains(github.ref, 'master')
80-
runs-on: ubuntu-latest
81-
needs: [build]
58+
containers: ['+(a11y|security|bugs)/**/*.js', 'features/**/+(o|d)*.js', 'features/**/m*.js', 'features/**/!(o|d|m)*.js']
8259

8360
steps:
84-
- uses: actions/checkout@v2
85-
- name: Use Node.js
86-
uses: actions/setup-node@v2
87-
with:
88-
node-version: 14.x
61+
- uses: actions/checkout@v2
62+
- name: Use Node.js 16.x
63+
uses: actions/setup-node@v2
64+
with:
65+
node-version: 16
66+
- name: Cache Node Modules
67+
id: cache-node-modules
68+
uses: actions/cache@v2
69+
with:
70+
path: node_modules
71+
key: node-modules-${{ hashFiles('package-lock.json') }}
72+
- name: Cache Cypress binary
73+
id: cache-cypress-binary
74+
uses: actions/cache@v2
75+
with:
76+
path: cypress/cache
77+
key: cypress-binary-${{ hashFiles('package-lock.json') }}
78+
- name: Install dependencies
79+
if: |
80+
steps.cache-node-modules.outputs.cache-hit != 'true' ||
81+
steps.cache-cypress-binary.outputs.cache-hit != 'true'
82+
run: npm ci
83+
- name: Cypress Test
84+
run: npx start-server-and-test cy:start http://localhost:3204 'npm run cy:run -- --spec "test/e2e-cypress/tests/${{ matrix.containers }}"'

config/jest/jest.artifact-es-bundle-core.config.js

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

config/jest/jest.artifact-es-bundle.config.js

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

config/jest/jest.artifact-umd-bundle.config.js renamed to config/jest/jest.artifact.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ const path = require('path');
33
module.exports = {
44
rootDir: path.join(__dirname, '..', '..'),
55
testEnvironment: 'jsdom',
6-
testMatch: ['**/test/build-artifacts/umd.js'],
6+
testMatch: ['**/test/build-artifacts/**/*.js'],
77
};

0 commit comments

Comments
 (0)