Skip to content

Commit

Permalink
ci: optimize speed of CI (#7649)
Browse files Browse the repository at this point in the history
Refs #7627
  • Loading branch information
char0n authored Nov 16, 2021
1 parent 0e5bc25 commit 9b5cbec
Show file tree
Hide file tree
Showing 7 changed files with 511 additions and 118 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/dependabot-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,7 @@ jobs:
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- name: 'Wait for status checks'
id: waitforstatuschecks
uses: WyriHaximus/github-action-wait-for-status@v1
with:
ignoreActions: Merge me!
checkInterval: 180
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Merge me!
if: steps.waitforstatuschecks.outputs.status == 'success'
uses: ahmadnassri/action-dependabot-auto-merge@v2
with:
target: minor
Expand Down
122 changes: 59 additions & 63 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,73 +16,69 @@ jobs:
build:
runs-on: ubuntu-latest

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

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v2
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Cache Cypress binary
id: cache-cypress-binary
uses: actions/cache@v2
with:
path: cypress/cache
key: cypress-binary-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: |
steps.cache-node-modules.outputs.cache-hit != 'true' ||
steps.cache-cypress-binary.outputs.cache-hit != 'true'
run: npm ci
- name: Lint code for errors only
run: npm run lint-errors
- name: Run all tests
run: npm test
env:
CI: true
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16
- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v2
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Cache Cypress binary
id: cache-cypress-binary
uses: actions/cache@v2
with:
path: cypress/cache
key: cypress-binary-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: |
steps.cache-node-modules.outputs.cache-hit != 'true' ||
steps.cache-cypress-binary.outputs.cache-hit != 'true'
run: npm ci
- name: Lint code for errors only
run: npm run lint-errors
- name: Run all tests
run: npm run just-test-in-node && npm run test:unit-jest
env:
CI: true
- name: Build SwaggerUI
run: npm run build
- name: Test build artifacts
run: npm run test:artifact

artifact-bundle:
e2e-tests:
runs-on: ubuntu-latest

strategy:
fail-fast: false
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 }}
- name: Cache Node Modules # artifact-bundle test is node-only, no Cypress
id: cache-node-modules
uses: actions/cache@v2
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
- name: Build and Run all artifact tests
run: npm run test:artifact

release:
if: contains(github.ref, 'master')
runs-on: ubuntu-latest
needs: [build]
containers: ['+(a11y|security|bugs)/**/*.js', 'features/**/+(o|d)*.js', 'features/**/m*.js', 'features/**/!(o|d|m)*.js']

steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 14.x
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16
- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v2
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Cache Cypress binary
id: cache-cypress-binary
uses: actions/cache@v2
with:
path: cypress/cache
key: cypress-binary-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: |
steps.cache-node-modules.outputs.cache-hit != 'true' ||
steps.cache-cypress-binary.outputs.cache-hit != 'true'
run: npm ci
- name: Cypress Test
run: npx start-server-and-test cy:start http://localhost:3204 'npm run cy:run -- --spec "test/e2e-cypress/tests/${{ matrix.containers }}"'
7 changes: 0 additions & 7 deletions config/jest/jest.artifact-es-bundle-core.config.js

This file was deleted.

7 changes: 0 additions & 7 deletions config/jest/jest.artifact-es-bundle.config.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ const path = require('path');
module.exports = {
rootDir: path.join(__dirname, '..', '..'),
testEnvironment: 'jsdom',
testMatch: ['**/test/build-artifacts/umd.js'],
testMatch: ['**/test/build-artifacts/**/*.js'],
};
Loading

0 comments on commit 9b5cbec

Please sign in to comment.