Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit f8435f2

Browse files
authored
Create maven.yml
1 parent de856fb commit f8435f2

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/maven.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3+
4+
name: Java CI with Maven
5+
6+
on:
7+
push:
8+
branches: [ main ]
9+
pull_request:
10+
branches: [ main ]
11+
workflow_dispatch:
12+
13+
jobs:
14+
get-exercises:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
matrix: ${{steps.list_dirs.outputs.matrix}}
18+
steps:
19+
- uses: actions/checkout@v2
20+
- id: list_dirs
21+
run: echo "::set-output name=matrix::$(ls code | jq -cnR '[inputs | select(length>0)]')"
22+
build:
23+
runs-on: ubuntu-latest
24+
needs: get-exercises
25+
strategy:
26+
matrix:
27+
subdir: ${{fromJson(needs.get-exercises.outputs.matrix)}}
28+
steps:
29+
- uses: actions/checkout@v3
30+
- name: Set up JDK
31+
uses: actions/setup-java@v3
32+
with:
33+
java-version: '17'
34+
distribution: 'temurin'
35+
cache: maven
36+
- name: Test with Maven
37+
run: mvn -B verify

0 commit comments

Comments
 (0)