Skip to content

Commit

Permalink
Merge pull request #77 from chabala/add-automated-build
Browse files Browse the repository at this point in the history
Add initial GitHub Actions build for Maven
  • Loading branch information
matty-r authored Dec 14, 2023
2 parents ca80a32 + 89f2774 commit 149d486
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 7 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build

on:
push:
branches: [ main ]
pull_request: # all pull requests
workflow_dispatch: # allow triggering manually

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'Check out repository'
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 'Set up Java 17'
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
cache: 'maven'

- name: 'Build'
run: |
xvfb-run mvn -V --batch-mode verify jacoco:report
- name: 'Store results'
uses: actions/upload-artifact@v3
with:
name: target
path: target/

53 changes: 46 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@
<version>4.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.11</version>
<type>maven-plugin</type>
</dependency>
</dependencies>

<build>
Expand All @@ -69,6 +63,10 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
Expand All @@ -91,5 +89,46 @@
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>urChatBasic.frontend.DriverGUI</mainClass>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
<reporting>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<reportSets>
<reportSet>
<reports>
<report>report</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
</project>

0 comments on commit 149d486

Please sign in to comment.