Skip to content
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
pull_request:
branches: [ main ]

env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
formatting:
name: Formatting (Isort & Black)
Expand Down
35 changes: 29 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ pipeline {
// Local virtual environment within the Jenkins workspace for portability
VENV_PATH = "${WORKSPACE}/.venv"
VENV_BIN = "${VENV_PATH}/bin"
// Opt into Node.js 24 for GitHub Actions if used via plugins
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 = 'true'
}

stages {
Expand Down Expand Up @@ -75,9 +77,19 @@ ET.ElementTree(root).write('isort-report.xml', xml_declaration=True, encoding='u
}
stage('Flake8') {
steps {
sh "rm -f flake8.txt flake8-report.xml"
sh "${VENV_BIN}/flake8 logflow tests examples --tee --output-file=flake8.txt || true"
sh "if [ -f flake8.txt ]; then ${VENV_BIN}/flake8_junit flake8.txt flake8-report.xml; fi"
script {
def rc = sh(script: "${VENV_BIN}/flake8 logflow tests examples > flake8-output.txt 2>&1", returnStatus: true)
sh """${VENV_BIN}/python3 -c "
import xml.etree.ElementTree as ET
rc = ${rc}
root = ET.Element('testsuite', name='flake8', tests='1', failures=str(min(rc, 1)))
tc = ET.SubElement(root, 'testcase', classname='flake8', name='lint-check')
if rc != 0:
with open('flake8-output.txt') as f:
ET.SubElement(tc, 'failure', message='Flake8 linting issues found').text = f.read()
ET.ElementTree(root).write('flake8-report.xml', xml_declaration=True, encoding='unicode')
" """
}
}
post {
always {
Expand All @@ -91,7 +103,9 @@ ET.ElementTree(root).write('isort-report.xml', xml_declaration=True, encoding='u
}
stage('Mypy') {
steps {
sh "${VENV_BIN}/mypy logflow tests examples --junit-xml=mypy-report.xml || true"
script {
sh "${VENV_BIN}/mypy logflow tests examples --junit-xml=mypy-report.xml || true"
}
}
post {
always {
Expand All @@ -115,8 +129,17 @@ ET.ElementTree(root).write('isort-report.xml', xml_declaration=True, encoding='u
// Archive and display JUnit test results
junit allowEmptyResults: true, testResults: 'test-report.xml'

// Display Coverage in Jenkins UI using Code Coverage API Plugin
recordCoverage tools: [[parser: 'COBERTURA', pattern: 'coverage.xml']]
// Display Coverage and Test Results as separate graphs using unique IDs
recordCoverage(
id: 'unit-tests',
name: 'Unit Tests',
tools: [[parser: 'JUNIT', pattern: 'test-report.xml']]
)
recordCoverage(
id: 'coverage',
name: 'Code Coverage',
tools: [[parser: 'COBERTURA', pattern: 'coverage.xml']]
)
}
}
}
Expand Down
Loading