Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build and launch
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Compile, package and launch (Java 8)
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6
with:
distribution: temurin
java-version: '8'
- name: Build and run through Gradle
run: bash ./gradlew --no-daemon clean build run
- name: Launch the packaged application
run: java -jar build/libs/ExampleApp.jar
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ExampleApp

A minimal Java console application built with the checked-in Gradle 5.2 wrapper and Java 8.

Build and launch: `bash ./gradlew --no-daemon clean build run`.
Run the packaged application: `java -jar build/libs/ExampleApp.jar`.

GitHub Actions checks compilation, packaging and both launch paths on pushes and pull requests. The existing JUnit method is an empty placeholder, so a successful build is not evidence of functional test coverage.
10 changes: 6 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ plugins {
}

repositories {
// Use jcenter for resolving your dependencies.
// Resolve dependencies from Maven Central.
// You can declare any Maven/Ivy/file repository here.
jcenter()
mavenCentral()
}

dependencies {
Expand All @@ -33,11 +33,13 @@ test {
}
}

mainClassName = 'main.java.ExampleApp.Main'

jar {
manifest {
attributes 'Main-Class': 'main.java.ExampleApp.Main'
attributes 'Main-Class': mainClassName
}
}

// Define the main class for the application
mainClassName = 'ExampleApp.Main'