ci: Improve CI performance (no-changelog) (#7637)

1. Split backend and frontend tests to avoid them running in parallel
2. Enable coverage only on `master`
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-11-07 14:19:39 +01:00
committed by GitHub
parent f748de9567
commit 2f665683fc
8 changed files with 46 additions and 44 deletions

View File

@@ -48,7 +48,8 @@ jobs:
with:
ref: ${{ inputs.branch }}
nodeVersion: ${{ matrix.node-version }}
cacheKey: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint
cacheKey: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint
collectCoverage: true
lint:
name: Lint changes

View File

@@ -18,11 +18,17 @@ on:
required: false
default: ''
type: string
collectCoverage:
required: false
default: 'false'
type: string
jobs:
unit-test:
name: Unit tests
runs-on: ubuntu-latest
env:
COVERAGE_ENABLED: ${{ inputs.collectCoverage }}
steps:
- uses: actions/checkout@v3.5.3
with:
@@ -51,10 +57,14 @@ jobs:
path: ./packages/**/dist
key: ${{ inputs.cacheKey }}
- name: Test
run: pnpm test
- name: Test Backend
run: pnpm test:backend
- name: Test Frontend
run: pnpm test:frontend
- name: Upload coverage to Codecov
if: ${{ inputs.collectCoverage == 'true' }}
uses: codecov/codecov-action@v3
with:
files: packages/@n8n/client-oauth2/coverage/cobertura-coverage.xml,packages/cli/coverage/cobertura-coverage.xml,packages/core/coverage/cobertura-coverage.xml,packages/design-system/coverage/cobertura-coverage.xml,packages/editor-ui/coverage/cobertura-coverage.xml,packages/nodes-base/coverage/cobertura-coverage.xml,packages/workflow/coverage/cobertura-coverage.xml