Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 10, 2025

This PR adds a GitHub Actions workflow that automatically runs the test suite on all pull requests targeting the master and develop branches.

What's Changed

Added .github/workflows/test.yml which:

  • Triggers on pull requests to the master and develop branches
  • Uses Node.js 20 (matching the project's requirements)
  • Installs dependencies with npm caching for faster runs
  • Verifies TypeScript compilation is up to date - Runs npm run tsc and fails if any files are modified, ensuring developers commit generated JavaScript files
  • Creates the required config.json file for tests
  • Runs the complete test suite via npm test, including:
    • TypeScript compilation
    • StandardJS linting
    • Mocha unit tests (121 tests covering download, filesystem, interpreter, middleware, utilities, and webhook modules)

Why This Change?

Currently, the project relies on manual testing or external CI systems. This workflow provides automated quality checks directly in GitHub, making it easier to catch issues early in the development process and ensuring all PRs meet the project's quality standards before merging.

The TypeScript compilation check ensures that all generated JavaScript files from TypeScript sources are kept in sync and committed, preventing issues where TypeScript changes are made but the compiled output is not updated in the repository.

Testing

The workflow configuration has been validated for:

  • ✅ Correct YAML syntax
  • ✅ Uses latest stable GitHub Actions (checkout@v4, setup-node@v4)
  • ✅ Follows the same test setup pattern as the existing CircleCI configuration
  • ✅ All 121 existing tests pass locally with this setup
  • ✅ TypeScript compilation check correctly identifies uncommitted changes

The workflow will be automatically tested when this PR is merged and subsequent PRs are opened.

Original prompt

add a github actions workflow that runs tests on PRs


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] Add GitHub Actions workflow for testing on PRs Add GitHub Actions workflow to run tests on pull requests Oct 10, 2025
Copilot AI requested a review from goransle October 10, 2025 08:04
@goransle
Copy link
Member

@copilot also make it run on the 'develop' branch

Copy link
Contributor Author

Copilot AI commented Oct 10, 2025

@copilot also make it run on the 'develop' branch

Added develop branch to the workflow triggers in commit 9311690.

@goransle goransle changed the base branch from master to develop October 10, 2025 08:10
@goransle
Copy link
Member

@copilot also add a check that tsc has been run correcly: there should be no diffing files after running npm run tsc

Copy link
Contributor Author

Copilot AI commented Oct 10, 2025

@copilot also add a check that tsc has been run correcly: there should be no diffing files after running npm run tsc

Added a check to verify TypeScript compilation is up to date. The workflow now runs npm run tsc and fails if there are any uncommitted changes, ensuring developers commit generated files. See commit 031f0e3.

@goransle goransle marked this pull request as ready for review October 10, 2025 08:26
@goransle goransle requested a review from Copilot October 10, 2025 08:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a GitHub Actions workflow for automated testing on pull requests targeting master and develop branches. The workflow ensures code quality by running the complete test suite and verifying TypeScript compilation is up to date.

  • Adds automated CI/CD pipeline with Node.js 20 and dependency caching
  • Implements TypeScript compilation verification to ensure generated files are committed
  • Creates required test configuration and runs the full test suite (121 tests)

Comment on lines +29 to +34
if [ -n "$(git status --porcelain)" ]; then
echo "Error: Files have changed after running 'npm run tsc'. Please run 'npm run tsc' locally and commit the changes."
git status
git diff
exit 1
fi
Copy link

Copilot AI Oct 10, 2025

Choose a reason for hiding this comment

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

[nitpick] The shell script logic is embedded in the YAML workflow. Consider extracting this into a separate script file for better readability and maintainability.

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

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

@copilot please fix

Copy link
Member

@goransle goransle left a comment

Choose a reason for hiding this comment

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

LGTM

@goransle goransle merged commit 285f69c into develop Oct 10, 2025
2 checks passed
@goransle goransle deleted the copilot/add-github-actions-workflow branch October 10, 2025 08:31
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