-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (38 loc) · 1.43 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: CI
on:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
workflow_dispatch:
env:
COMMIT_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
BRANCH: ${{ github.event_name == 'pull_request' && format('refs/heads/{0}', github.event.pull_request.head.ref) || github.ref }}
jobs:
build:
name: Build code.maoudia.com
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- run: 'wget https://github.com/docker/compose/releases/download/v2.22.0/docker-compose-linux-x86_64'
- run: 'sudo mv docker-compose-linux-x86_64 /usr/libexec/docker/cli-plugins/docker-compose'
- run: 'sudo chmod +x /usr/libexec/docker/cli-plugins/docker-compose'
- name: Set up JDK 21 for x64
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
architecture: x64
cache: maven
- name: Build and test Maven projects
run: |
for project in $(find . -name "pom.xml" -exec dirname {} \;); do
echo "Building and testing project in folder: $project"
(cd "$project" && mvn --batch-mode --update-snapshots --no-transfer-progress verify -Dspring.profiles.active=test)
if [ $? -ne 0 ]; then
echo "Failed to build or test project in folder: $project"
exit 1
fi
done