Skip to content

Commit 33054b4

Browse files
authored
Create build and test GitHub action
1 parent 9c36f51 commit 33054b4

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/build-and-test.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
3+
4+
name: Build and Deployment Test
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout main branch from repository
19+
uses: actions/checkout@v4
20+
- name: Set up JDK 17
21+
uses: actions/setup-java@v4
22+
with:
23+
java-version: '17'
24+
distribution: 'temurin'
25+
cache: maven
26+
- name: Build the project with Maven
27+
run: mvn -B package --file pom.xml
28+
# -B: Runs in batch mode (non-interactive)
29+
# package: Creates JAR/WAR file
30+
- name: Run unit tests with Maven
31+
run: mvn test
32+
33+
# # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
34+
# - name: Update dependency graph
35+
# uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6

0 commit comments

Comments
 (0)