Skip to content

Implementation of GitHub Actions #541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 15, 2025
Merged

Conversation

PhilippSchmelter
Copy link
Contributor

Closes #540

This pull request introduces a comprehensive CI/CD pipeline using GitHub Actions, implements semantic versioning, and adds automated branch name validation. The key changes are grouped into CI/CD pipeline setup, semantic versioning tasks, and branch name validation.

CI/CD Pipeline Setup:

  • Added a CI workflow to build, test, and deploy the project using GitHub Actions. This includes steps for checking out the source, setting up Java and Gradle, running tests, and deploying to Maven Central. (.github/workflows/ci.yml)
  • Created a workflow to automatically merge Dependabot pull requests if they meet specific criteria. (.github/workflows/dependabot-auto-merge.yml)

Semantic Versioning:

  • Added Gradle tasks for managing and printing the current and development versions based on semantic versioning. (gradle/scripts/semVer.gradle)
  • Introduced scripts to fetch and compare versions from different branches to enforce versioning rules during pull requests. (scripts/get_versions.sh, scripts/run-version-check.sh, scripts/version_check.sh) [1] [2] [3]
  • Updated version.properties to include semantic versioning details. (version.properties)

Branch Name Validation:

  • Implemented a Gradle task to validate branch names against predefined patterns to ensure they follow the required naming conventions. (gradle/scripts/branchName.gradle)
  • Added a script to determine the branch type based on its name and set the corresponding environment variable. (scripts/branch_type.sh)

Documentation:

  • Updated the CHANGELOG.md to include the addition of the GitHub Actions pipeline. (CHANGELOG.md)

@PhilippSchmelter PhilippSchmelter added the ci Related to continuous integration label Apr 9, 2025
@PhilippSchmelter PhilippSchmelter self-assigned this Apr 9, 2025
Copy link

@Copilot 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.

Copilot reviewed 4 out of 11 changed files in this pull request and generated no comments.

Files not reviewed (7)
  • gradle/scripts/branchName.gradle: Language not supported
  • gradle/scripts/semVer.gradle: Language not supported
  • scripts/branch_type.sh: Language not supported
  • scripts/get_versions.sh: Language not supported
  • scripts/run-version-check.sh: Language not supported
  • scripts/version_check.sh: Language not supported
  • version.properties: Language not supported
Comments suppressed due to low confidence (2)

.github/workflows/dependabot-auto-merge.yml:21

  • Ensure the GitHub CLI ('gh') is available in the runner environment. Without it, the auto-merge step may fail; alternatively, consider using an existing GitHub Action to merge pull requests.
run: gh pr merge --auto --merge "$PR_URL"

.github/workflows/ci.yml:90

  • [nitpick] For consistency with earlier steps that extract the branch name into BRANCH_NAME, consider revisiting the deployment condition to use a unified variable reference.
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'

@PhilippSchmelter PhilippSchmelter requested a review from Copilot April 9, 2025 23:30
Copy link

@Copilot 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.

Copilot reviewed 4 out of 11 changed files in this pull request and generated no comments.

Files not reviewed (7)
  • gradle/scripts/branchName.gradle: Language not supported
  • gradle/scripts/semVer.gradle: Language not supported
  • scripts/branch_type.sh: Language not supported
  • scripts/get_versions.sh: Language not supported
  • scripts/run-version-check.sh: Language not supported
  • scripts/version_check.sh: Language not supported
  • version.properties: Language not supported

@sebastian-peter sebastian-peter marked this pull request as draft April 10, 2025 11:39
Copy link
Member

@sebastian-peter sebastian-peter left a comment

Choose a reason for hiding this comment

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

@PhilippSchmelter Similar feedback to ie3-institute/MobilitySimulator#352 (review):

I think if we get semver in first, this should work :)

@sebastian-peter sebastian-peter added this to the Version 3.0 milestone Apr 15, 2025
@sebastian-peter sebastian-peter marked this pull request as ready for review April 15, 2025 16:50
Copy link

Passed

Analysis Details

0 Issues

  • Bug 0 Bugs
  • Vulnerability 0 Vulnerabilities
  • Code Smell 0 Code Smells

Coverage and Duplications

  • Coverage No coverage information (65.80% Estimated after merge)
  • Duplications No duplication information (0.00% Estimated after merge)

Project ID: edu.ie3:utils

View in SonarQube

Copy link
Member

@sebastian-peter sebastian-peter left a comment

Choose a reason for hiding this comment

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

Looks good, let's give it a try also in here!

@sebastian-peter sebastian-peter merged commit 0fa1d47 into main Apr 15, 2025
4 checks passed
@sebastian-peter sebastian-peter deleted the ps/#540-GitHubActions branch April 15, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Related to continuous integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implementing GitHub Actions Pipeline
2 participants