Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 12, 2025

Extracts build, lint, and test logic from continuous-integration.yml into separate composite actions. Adds PR reporting for lint (GitHub annotations) and test (ReportGenerator + Codecov).

New Composite Actions

  • actions/build - Build execution with env/secrets management and artifact upload
  • actions/lint - Linting with auto-detected report processing (ESLint JSON/Checkstyle XML → GitHub annotations)
  • actions/test - Test execution with coverage reporting (Codecov with OIDC + ReportGenerator for PR comments)

Key Features

Implementation

  • All actions use actions/github-script with @actions/exec for better error handling
  • Uses exec.getExecOutput() for proper exit code management and output capture
  • Post-processing steps use if: always() to ensure reports are generated even on failure
  • Clean, minimal code without unnecessary require statements

Auto-Detection

  • Lint reports: Automatically detects common lint report files (eslint-report.json, checkstyle.xml, etc.) and format
  • Coverage files: Automatically detects common coverage files (cobertura-coverage.xml, lcov.info, clover.xml, etc.)
  • Zero configuration needed for standard project layouts

Lint Report Processing

  • Uses eslint-annotate-action for ESLint JSON reports
  • Uses checkstyle-github-action for Checkstyle XML reports
  • Format is automatically detected from file extension
  • Actions always fail on linting errors for consistency

Coverage Reporters

  • Codecov: Always uses OIDC authentication (no token needed)
  • GitHub (default): PR comment integration via ReportGenerator supporting multiple formats (Cobertura, OpenCover, lcov, JaCoCo, etc.)
  • Uses hoverkraft-tech/ci-github-common/actions/create-or-update-comment for PR comments
  • Markdown summary generation for comprehensive PR feedback

Dependency Installation

  • Uses jaxxstorm/action-install-gh-release for portable Codecov dependency installation in containers

Container Mode Support
All actions support execution inside Docker containers (e.g., pre-built CI images)

Usage

# Lint with auto-detection (minimal configuration)
- uses: ./actions/lint
  with:
    working-directory: "."

# Lint with manual report file specification (optional)
- uses: ./actions/lint
  with:
    working-directory: "."
    report-file: "custom-lint-report.json"

- uses: ./actions/build
  with:
    build-commands: |
      build
      package
    build-artifact: '{"name": "dist", "paths": "dist/"}'

# Test with default "github" coverage (minimal configuration)
- uses: ./actions/test
  with:
    github-token: ${{ github.token }}

# Test with Codecov
- uses: ./actions/test
  with:
    coverage: "codecov"

# Test with custom coverage files
- uses: ./actions/test
  with:
    coverage-files: "coverage/custom-coverage.xml"
    github-token: ${{ github.token }}

Design Decisions

  • Opinionated defaults: Actions default to "github" coverage and always fail on errors for consistency
  • Auto-detection first: Manual configuration only needed for non-standard paths
  • OIDC only: Codecov always uses OIDC authentication (simpler, more secure)
  • Minimal inputs: Removed fail-on-error, report-format, and codecov-token inputs to reduce complexity

Workflow Impact

continuous-integration.yml reduced from 489 to 377 lines. Jobs now delegate to composite actions while maintaining identical functionality.

Original prompt

On continuous-integration.yml, refactor: move built lint and test in separated dedicated composite actions (./actions/build, ./actions/lint, ./actions/test).

In lint and test we must support pull request reporting.

If the lint run generate a report file, we must process it as github annotation.
For test, we must alos support lco reporter action in addition to codecoverage


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Refactor CI to use dedicated actions for lint and test Refactor: Extract build, lint, and test into dedicated composite actions Nov 12, 2025
Copilot AI requested a review from neilime November 12, 2025 10:00
Copilot AI and others added 4 commits November 12, 2025 11:02
Co-authored-by: neilime <314088+neilime@users.noreply.github.com>
Co-authored-by: neilime <314088+neilime@users.noreply.github.com>
Co-authored-by: neilime <314088+neilime@users.noreply.github.com>
Co-authored-by: neilime <314088+neilime@users.noreply.github.com>
@neilime neilime force-pushed the copilot/refactor-ci-actions-lint-test branch from cc62c7e to db1c1d3 Compare November 12, 2025 10:02
Co-authored-by: neilime <314088+neilime@users.noreply.github.com>
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
@neilime neilime force-pushed the copilot/refactor-ci-actions-lint-test branch from db1c1d3 to 893bff4 Compare November 12, 2025 10:12
Copy link
Member

@neilime neilime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot handle feedbacks

@neilime neilime changed the title Refactor: Extract build, lint, and test into dedicated composite actions feat(continuous-integration): Extract build, lint, and test into dedicated composite actions Nov 12, 2025
@neilime neilime marked this pull request as ready for review November 12, 2025 10:26
…ting

- Replace bash scripts with actions/github-script for better error handling
- Change coverage type from "lcov" to "github" with ReportGenerator support
- Use eslint-annotate-action for ESLint report processing
- Use checkstyle-github-action for Checkstyle report processing
- Add always() condition for post-processing steps
- Update documentation to reflect new inputs and supported formats
- Add jscpd:ignore markers to handle expected README duplication

Co-authored-by: neilime <314088+neilime@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 12, 2025

@copilot handle feedbacks

✅ All feedbacks addressed in commit ef0509d:

  • Replaced bash scripts with actions/github-script for all actions
  • Changed coverage from "lcov" to "github" with ReportGenerator support
  • Integrated eslint-annotate-action and checkstyle-github-action
  • Added if: always() for post-processing steps
  • Updated documentation for new inputs and formats

Note: There are jscpd warnings about duplication in README boilerplate sections (license, contributing, etc.), which is expected and intentional for consistent documentation across actions.

Copilot AI changed the title feat(continuous-integration): Extract build, lint, and test into dedicated composite actions Refactor: Extract build, lint, and test into dedicated composite actions Nov 12, 2025
Copilot AI requested a review from neilime November 12, 2025 10:48
Copy link
Member

@neilime neilime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot handle feedbacks

- Replace child_process with @actions/exec package
- Use exec.getExecOutput for better error handling
- Use node:path instead of path
- Add auto-detection for lint report files (eslint-report.json, checkstyle.xml, etc.)
- Add auto-detection for coverage files (cobertura-coverage.xml, lcov.info, etc.)
- Update documentation to reflect auto-detection capabilities

Co-authored-by: neilime <314088+neilime@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 12, 2025

@copilot handle feedbacks

✅ All feedbacks addressed in commit 90dd79c:

  • Replaced child_process with @actions/exec package
  • Updated to use node:path for native module syntax
  • Using exec.getExecOutput() for better error handling and exit codes
  • Added auto-detection for lint report files (eslint, checkstyle)
  • Added auto-detection for coverage files (cobertura, lcov, clover, etc.)

All actions now follow GitHub Actions best practices with improved developer experience through auto-detection.

Copilot AI requested a review from neilime November 12, 2025 12:29
Copy link
Member

@neilime neilime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot handle feedbacks

Copy link
Contributor Author

Copilot AI commented Nov 12, 2025

@copilot handle feedbacks

✅ All feedbacks addressed in commit dde8f0c:

  • Removed unnecessary require statements (available by default)
  • Removed report-format input (always auto-detect)
  • Removed fail-on-error inputs (always fail on errors)
  • Changed coverage default to "github"
  • Removed codecov-token input (always use OIDC)
  • Replaced sticky-pull-request-comment with internal action
  • Using jaxxstorm/action-install-gh-release for dependencies
  • Removed redundant failure checks

Actions are now simpler with better defaults and more consistent behavior.

Copilot AI requested a review from neilime November 12, 2025 14:19
@neilime neilime changed the title Refactor: Extract build, lint, and test into dedicated composite actions refactor: extract build, lint, and test into dedicated composite actions Nov 12, 2025
@neilime neilime force-pushed the copilot/refactor-ci-actions-lint-test branch 9 times, most recently from 2e475b4 to 5a4ce1d Compare November 12, 2025 16:53
@github-actions
Copy link
Contributor

github-actions bot commented Nov 12, 2025

Code Coverage Report

Summary

Summary
Generated on: 11/12/2025 - 19:27:21
Parser: LCov
Assemblies: 1
Classes: 1
Files: 1
Line coverage: 100% (2 of 2)
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 5
Method coverage: Feature is only available for sponsors
Tag: 441_19309278755

Coverage

Default - 100%
Name Line
Default 100%
src/index.js 100%

@neilime neilime force-pushed the copilot/refactor-ci-actions-lint-test branch 3 times, most recently from b45dd88 to 3857652 Compare November 12, 2025 17:47
- Remove require statements for path/exec (available by default in github-script)
- Remove report-format input from lint action (always auto-detect)
- Remove fail-on-error inputs (always fail on error for consistency)
- Change test coverage default to "github" for better DX
- Remove codecov-token input (always use OIDC)
- Update codecov action to always use OIDC
- Replace sticky-pull-request-comment with hoverkraft create-or-update-comment
- Use jaxxstorm/action-install-gh-release for codecov dependencies
- Remove redundant final failure checks (handled in main script)

Co-authored-by: neilime <314088+neilime@users.noreply.github.com>
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
@neilime neilime force-pushed the copilot/refactor-ci-actions-lint-test branch from 3857652 to c23133c Compare November 12, 2025 19:23
@neilime neilime changed the title refactor: extract build, lint, and test into dedicated composite actions feat(continuous-integration)!: add better reporting for lint and tests Nov 12, 2025
@neilime neilime merged commit b9cafc2 into main Nov 12, 2025
61 checks passed
@neilime neilime deleted the copilot/refactor-ci-actions-lint-test branch November 12, 2025 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants