Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: optimize workflows #7649

Merged
merged 23 commits into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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