Skip to content

Commit b7c22d5

Browse files
committed
Add Github actions workflow for Spring Boot HATEOAS
1 parent eb729e6 commit b7c22d5

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/build.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build and Test Spring Boot HATEOAS
2+
3+
# Pode rodar manualmente ou em push
4+
on:
5+
push:
6+
branches: [ main ]
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
# Pega o código do repo
15+
- name: Checkout repo
16+
uses: actions/checkout@v4
17+
18+
# Setup Java
19+
- name: Set up JDK 21
20+
uses: actions/setup-java@v3
21+
with:
22+
distribution: temurin
23+
java-version: 21
24+
25+
# Cache do Maven (opcional, acelera builds)
26+
- name: Cache Maven packages
27+
uses: actions/cache@v3
28+
with:
29+
path: ~/.m2/repository
30+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
31+
restore-keys: |
32+
${{ runner.os }}-maven-
33+
34+
# Build com Maven
35+
- name: Build with Maven
36+
run: mvn clean install --no-transfer-progress
37+
38+
# Run tests
39+
- name: Run tests
40+
run: mvn test
41+
42+
# Arquivos gerados (opcional)
43+
- name: Upload build artifacts
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: target
47+
path: target/
48+

0 commit comments

Comments
 (0)