Skip to content

Commit dba9ecc

Browse files
committed
Add GitHub Actions workflow for building and testing with Maven
1 parent f575192 commit dba9ecc

File tree

3 files changed

+45
-70
lines changed

3 files changed

+45
-70
lines changed

.github/workflows/build.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build and Submit Dependencies
2+
3+
on:
4+
push:
5+
branches: [ main, master, develop ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
permissions:
10+
contents: read
11+
actions: read
12+
security-events: write
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Set up JDK 17
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: '17'
26+
distribution: 'temurin'
27+
28+
- name: Cache Maven dependencies
29+
uses: actions/cache@v4
30+
with:
31+
path: ~/.m2
32+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
33+
restore-keys: ${{ runner.os }}-m2
34+
35+
- name: Build with Maven
36+
run: mvn clean compile -DskipTests
37+
38+
- name: Run tests
39+
run: mvn test
40+
41+
- name: Submit Dependency Snapshot
42+
uses: advanced-security/maven-dependency-submission-action@v4
43+
with:
44+
settings-file: ''
45+
ignore-maven-wrapper: false

.github/workflows/maven.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/maven_spring.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)