-
Notifications
You must be signed in to change notification settings - Fork 12
69 lines (57 loc) · 2.35 KB
/
test.yaml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Pogues Back Office tests
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore: ['docs/**', 'Dockerfile', 'LICENSE', 'CHANGELOG.md', 'README.md']
jobs:
pogues-model:
name: Check Pogues-Model lib version exists
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Get Pogues-Model Version
id: get-version
run: echo "version=$(mvn help:evaluate -Dexpression='pogues-model.version' -q -DforceStdout)" >> $GITHUB_OUTPUT
- name: Check Pogues-Model lib tag ${{ steps.get-version.outputs.version }} existence
id: check-tag-exists
uses: mukunku/[email protected]
with:
repo: InseeFr/Pogues-Model
tag: ${{ steps.get-version.outputs.version }}
- name: Pogues-Model lib tag verification
id: check-tag
run: |
if [[ "${{ steps.check-tag-exists.outputs.exists }}" == "false" ]]; then
echo "The tag v${{ steps.get-version.outputs.version }} doesn't exist in Eno lib repo."
exit 1
fi
test:
needs: pogues-model
if: ${{ (github.event.pull_request.draft == false) && !contains(github.event.pull_request.labels.*.name, 'deploy-snapshot') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "21"
- name: Checkout Pogues-Model lib repo
uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ needs.pogues-model.outputs.version }}
repository: InseeFr/Pogues-Model
path: Pogues-Model
- name: Build Pogues-Model lib
working-directory: ./Pogues-Model
run: mvn install --no-transfer-progress -DskipTests=true -Dmaven.javadoc.skip=true
- name: Run tests with Maven
run: mvn test --no-transfer-progress
# - name: Test, package and analyze with maven & SonarCloud
# run: mvn --no-transfer-progress verify sonar:sonar -Dsonar.projectKey=InseeFr_Pogues-Back-Office -Dsonar.organization=inseefr -Dsonar.host.url=https://sonarcloud.io
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}