Skip to content

Add GitHub Actions CI workflow for build and test#50

Merged
tastybento merged 2 commits intodevelopfrom
copilot/add-github-actions-workflow
Mar 17, 2026
Merged

Add GitHub Actions CI workflow for build and test#50
tastybento merged 2 commits intodevelopfrom
copilot/add-github-actions-workflow

Conversation

Copy link
Contributor

Copilot AI commented Mar 17, 2026

No CI pipeline existed for the repository. This adds a GitHub Actions workflow that compiles and tests the project on every push and PR targeting develop.

Workflow: .github/workflows/build.yml

  • Triggers: push and pull_request on develop
  • Java: 21 (Temurin), with Maven dependency caching
  • Steps:
    • Compile: mvn -B clean compile
    • Test: mvn -B test (via Maven Surefire plugin as configured in pom.xml)
  • Permissions: GITHUB_TOKEN scoped to contents: read
Original prompt

Create a GitHub Actions workflow that builds and tests the code for the BentoBoxWorld/Chat repository. The latest code relies on Maven as indicated by the pom.xml configuration. Ensure the workflow includes steps to: 1. Checkout the code. 2. Use Java 21 as per Maven configuration. 3. Build the project with Maven. 4. Run tests using the Maven Surefire plugin. This action should trigger for push events to develop and when pull requests target develop.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Add an Action to build and run tests when a commit is made or pr

Assistant: To achieve this, you can create a GitHub Actions workflow file that automatically builds and runs tests whenever a commit is pushed or a pull request is opened. This requires adding a YAML file to the .github/workflows directory in your repository.

Here's an example workflow file:

Suggested Workflow File

name: Build and Test

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  build-and-test:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Set up Java (if applicable)
        uses: actions/setup-java@v3
        with:
          java-version: '17' # Adjust the version to your needs.

      - name: Install dependencies
        run: |
          ./gradlew dependencies # Adjust the build tool or dependencies installation command
  
      - name: Build application
        run: |
          ./gradlew build # Adjust the build command

      - name: Run tests
        run: |
          ./gradlew test # Adjust with the appropriate testing command

The setup includes:

  • push: Ensures the action runs when a commit is pushed to the main branch.
  • pull_request: Triggers the action on pull requests targeting the main branch.
  • Steps to check out the repository, set up the environment, build the code base, and execute tests.

Would you like me to create a pull request to add this file? Or do you have specific requirements for the workflow?

User: Yes make one. Look at the Pom for the details.

Assistant: I have created and proposed a pull request to add a GitHub Actions workflow that builds and tests the code on push and pull request events, as per the pom.xml configuration. Let me know if you'd like further adjustments!

User: Accepted Confirmation: Are you sure?

Assistant: It seems the repository or the base branch main might not exist in the BentoBoxWorld/Chat repository. Could you clarify if another branch, such as master, should be used as the base branch for this workflow?

User: develop is the main. Master is the release branch. So make it in develop.

Assistant: I have created a pull request to add a GitHub Actions workflow that builds and tests the code, targeting the develop branch as the default branch. Let me know if you need further assistance!

This pull request was created from Copilot chat.


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

Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Copilot AI changed the title [WIP] Add GitHub Actions workflow for build and test Add GitHub Actions CI workflow for build and test Mar 17, 2026
Copilot AI requested a review from tastybento March 17, 2026 03:16
@tastybento tastybento marked this pull request as ready for review March 17, 2026 03:17
@tastybento tastybento merged commit 94f899b into develop Mar 17, 2026
1 check failed
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