Skip to content

Commit

Permalink
ci: Fix code coverage collection (#12443)
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy authored Jan 6, 2025
1 parent 39d5e0f commit f043ff1
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
nodeVersion: ${{ matrix.node-version }}
cacheKey: ${{ github.sha }}-base:build
collectCoverage: ${{ matrix.node-version == '20.x' }}
ignoreTurboCache: ${{ matrix.node-version == '20.x' }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/units-tests-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ on:
required: false
default: false
type: boolean
ignoreTurboCache:
required: false
default: false
type: boolean
secrets:
CODECOV_TOKEN:
description: 'Codecov upload token.'
Expand All @@ -32,6 +36,7 @@ jobs:
name: Unit tests
runs-on: ubuntu-latest
env:
TURBO_FORCE: ${{ inputs.ignoreTurboCache }}
COVERAGE_ENABLED: ${{ inputs.collectCoverage }}
steps:
- uses: actions/[email protected]
Expand Down Expand Up @@ -73,6 +78,6 @@ jobs:

- name: Upload coverage to Codecov
if: inputs.collectCoverage
uses: codecov/codecov-action@v4.5.0
uses: codecov/codecov-action@v5.1.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
58 changes: 58 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
codecov:
max_report_age: off
require_ci_to_pass: true

coverage:
status:
patch: false
project:
default:
threshold: 0.5%

github_checks:
annotations: false

flags:
tests:
paths:
- "**"
carryforward: true

component_management:
default_rules:
statuses:
- type: project
target: auto
branches:
- "!master"
individual_components:
- component_id: backend_packages
name: Backend
paths:
- packages/@n8n/api-types/**
- packages/@n8n/config/**
- packages/@n8n/client-oauth2/**
- packages/@n8n/imap/**
- packages/@n8n/permissions/**
- packages/@n8n/task-runner/**
- packages/n8n-workflow/**
- packages/n8n-core/**
- packages/n8n-node-dev/**
- packages/n8n/**
- component_id: frontend_packages
name: Frontend
paths:
- packages/@n8n/chat/**
- packages/@n8n/codemirror-lang/**
- packages/n8n-design-system/**
- packages/n8n-editor-ui/**
- component_id: nodes_packages
name: Nodes
paths:
- packages/n8n-nodes-base/**
- packages/@n8n/n8n-nodes-langchain/**

ignore:
- (?s:.*/[^\/]*\.spec\.ts.*)\Z
- (?s:.*/[^\/]*\.test\.ts.*)\Z
- (?s:.*/[^\/]*e2e[^\/]*\.ts.*)\Z
11 changes: 7 additions & 4 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", "coverage/**"]
"outputs": ["dist/**"]
},
"typecheck": {
"dependsOn": ["^typecheck"]
Expand Down Expand Up @@ -66,18 +66,21 @@
"n8n-workflow#test",
"n8n-core#test",
"n8n#test"
]
],
"outputs": ["coverage/**"]
},
"test:frontend": {
"dependsOn": [
"@n8n/chat#test",
"@n8n/codemirror-lang#test",
"n8n-design-system#test",
"n8n-editor-ui#test"
]
],
"outputs": ["coverage/**"]
},
"test:nodes": {
"dependsOn": ["n8n-nodes-base#test", "@n8n/n8n-nodes-langchain#test"]
"dependsOn": ["n8n-nodes-base#test", "@n8n/n8n-nodes-langchain#test"],
"outputs": ["coverage/**"]
},
"test": {},
"watch": {
Expand Down

0 comments on commit f043ff1

Please sign in to comment.