forked from mercedes-benz/sechub
-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (112 loc) · 4.64 KB
/
gradle.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# SPDX-License-Identifier: MIT
name: Java & Go CI
on:
push:
branches-ignore:
# we do NOT build the documentation branch, because here we only copy build output
# of documentation from master branch to the corresponding doc folders -e.g. /docs/latest
# So this branch is only for github pages. See https://github.com/mercedes-benz/sechub/issues/481
# for details
- documentation
# We ignore everything where tag starts with v* - this is done by release build!
tags-ignore:
- v*
# enable manual triggering of workflow
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Set up JDK 17
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0
with:
java-version: 17
distribution: temurin
- name: Set up Gradle
uses: gradle/gradle-build-action@842c587ad8aa4c68eeba24c396e15af4c2e9f30a
with:
cache-read-only: false
- name: Set up Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
go-version: 1.20.4
- uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Gradle clean + spotlessCheck
run: ./gradlew clean spotlessCheck
- name: Build Client
run: ./gradlew :sechub-cli:buildGo :sechub-cli:testGo
- name: Build Server, DAUI and generate OpenAPI file
run: ./gradlew ensureLocalhostCertificate build generateOpenapi buildDeveloperAdminUI -x :sechub-cli:build
- name: Generate and build Java projects related to SecHub Java API
run: ./gradlew :sechub-api-java:build :sechub-systemtest:build :sechub-pds-tools:buildPDSToolsCLI -Dsechub.build.stage=api-necessary
# Integration test
- name: Integration test
run: ./gradlew :sechub-integrationtest:startIntegrationTestInstances :sechub-systemtest:integrationtest :sechub-integrationtest:integrationtest :sechub-integrationtest:stopIntegrationTestInstances -Dsechub.build.stage=all --console=plain
# We use 'if: always()' to run a step even if a previous step failed
- name: Create combined test report
if: always()
run: ./gradlew createCombinedTestReport -Dsechub.build.stage=all
# -----------------------------------------
# Upload Build Artifacts
# -----------------------------------------
- name: Archive combined test report
if: always()
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: combined-sechub-testreport
path: build/reports/combined-report
retention-days: 14
- name: Archive sechub server artifacts
if: always()
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: sechub-server
path: sechub-server/build/libs
retention-days: 14
- name: Archive pds server artifacts
if: always()
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: sechub-pds
path: sechub-pds/build/libs
- name: Archive pds tools artifacts
if: always()
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: sechub-pds-tools
path: sechub-pds-tools/build/libs
- name: Archive developer tools artifacts
if: always()
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: sechub-developertools
path: sechub-developertools/build/libs
retention-days: 14
- name: Archive sechub client artifacts
if: always()
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: sechub-client
path: sechub-cli/build/go
retention-days: 14
- name: Archive sechub integration test report artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: sechub-integrationtest-test-reports
path: sechub-integrationtest/build/sechub-test-reports
retention-days: 14
- name: Archive openAPI3 JSON files
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: sechub-api-spec
path: sechub-doc/build/api-spec/
retention-days: 14