File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Java CI with Maven
2+
3+ on :
4+ push :
5+ branches : [ "main" ]
6+ pull_request :
7+ branches : [ "main" ]
8+
9+ jobs :
10+ build_and_test :
11+ name : Build & Test (Java ${{ matrix.version }})
12+ runs-on : ubuntu-latest
13+ strategy :
14+ matrix :
15+ version : ["23", "24"]
16+
17+ steps :
18+ - uses : actions/checkout@v4
19+
20+ - name : Set up JDK ${{ matrix.version }}
21+ uses : actions/setup-java@v4
22+ with :
23+ java-version : ${{ matrix.version }} # Här använder vi matrisen korrekt!
24+ distribution : ' temurin'
25+ cache : maven
26+
27+ # VIKTIGT: Eftersom din LogConfig läser .env, måste vi skapa en tillfällig sådan för testerna
28+ - name : Create dummy .env for CI
29+ run : echo "DATABASE_URL=jdbc:sqlite:test.db" > .env
30+
31+ - name : Build and Run Tests
32+ run : mvn -B clean verify # verify kör även coverage-plugins om de finns i din pom.xml
33+
34+ formatting :
35+ runs-on : ubuntu-latest
36+ steps :
37+ - uses : actions/checkout@v4
38+ - uses : axel-op/googlejavaformat-action@v4
39+ with :
40+ args : " --set-exit-if-changed"
You can’t perform that action at this time.
0 commit comments