Skip to content

Commit

Permalink
ci: Update CI workflow and add JUnit test reporting (#192)
Browse files Browse the repository at this point in the history
- **CI/CD**
  - Simplified GitHub Actions workflow to focus on main branch
  - Added JUnit test result summary reporting
  - Enhanced test job error handling

- **Development Tools**
  - Updated pytest configuration for improved test reporting and caching
  - Refined linting configuration
  - Added new development task to clean cache and coverage files
  • Loading branch information
jjjermiah authored Jan 21, 2025
1 parent cf5cbd0 commit 8ccc0c0
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI-CD
# only run on pushes to main or pull requests
on:
push:
branches: ["main", "jjjermiah/devel/main"]
branches: ["main"]
pull_request:
branches: ["*"]

Expand All @@ -14,6 +14,7 @@ jobs:
Unit-Tests:
runs-on: ${{ matrix.os }}
timeout-minutes: 15 # Consider increasing timeout
continue-on-error: true # dont fail the whole matrix if one fails
strategy:
matrix:
os: [ubuntu-latest, macos-latest, macos-14] # , windows-latest removed for now
Expand Down Expand Up @@ -42,6 +43,14 @@ jobs:
name: coverage-report
path: coverage-report

- name: JUnit Test Summary
id: pytest-summary
uses: test-summary/action@v2
with:
paths: .cache/test-results/**/*.xml
show: all
if: always()

################################################################################################
# Build-Docs: Build documentation using mkdocs
################################################################################################
Expand Down
15 changes: 13 additions & 2 deletions config/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Ensures compatibility with the specified features
minversion = 7.0

cache_dir = .cache

# Additional command-line options to always include
# Sets default behavior for test runs
addopts =
Expand All @@ -27,7 +29,12 @@ addopts =
# Point to coverage config file
# Allows customization of coverage report generation
--cov-config=config/coverage.toml


# Junit params
# XML path
--junitxml=.cache/test-results/junit.xml


# Patterns for test discovery
# Defines which files are considered test files
testpaths =
Expand Down Expand Up @@ -57,4 +64,8 @@ console_output_style = progress
filterwarnings =
ignore::DeprecationWarning
# Add specific warning messages to ignore here
ignore::UserWarning:pydicom.*
ignore::UserWarning:pydicom.*

# JUnit XML report
# Junit is a widely used XML format for test reports
junit_suite_name = imgtools
1 change: 0 additions & 1 deletion config/ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ extend-exclude = [

extend-include = ["src/imgtools/ops/functional.py"]


line-length = 100

[lint]
Expand Down
7 changes: 7 additions & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ jupyterlab = "*"
[feature.dev.activation.env]
IMGTOOLS_LOG_LEVEL = "DEBUG"

[feature.dev.tasks]
clean = { cmd = [
"bash",
"-c",
"rm -rf .cache && find . -type f -name '.coverage*' -exec rm -f {} +"
], description = "Clear cache and coverage files"}

############################################## PYTHON ###############################################

[feature.py310.dependencies]
Expand Down

0 comments on commit 8ccc0c0

Please sign in to comment.