-
Notifications
You must be signed in to change notification settings - Fork 27
69 lines (64 loc) · 1.93 KB
/
build.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
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: Java CI
on:
push:
branches:
- 'main'
pull_request:
jobs:
check_commit_hooks:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Run pre-commit check
uses: pre-commit/[email protected]
build_java:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Build with Gradle
run: ./gradlew build
- name: Run sonar analysis
# As the secrets below are only correctly stored within our github account,
# we need to disable the sonar run for forked repositories. Otherwise, remote
# PRs would not be able to pass the CI check.
if: ${{ github.repository == 'TNG/keycloak-mock' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_LOGIN }}
run: ./gradlew sonar
- name: Run integration tests
run: ./gradlew e2e
- name: Publish test report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
check_name: JUnit Test Report
- name: Upload cypress output
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-reports-js
path: |
*/cypress/screenshots/
*/cypress/videos/
# e2e tests will not be run if unit tests fail, so it is ok if we find no artifacts
if-no-files-found: ignore