Skip to content

Merge pull request #3134 from mercedes-benz/feature-3133-restrict-rem… #4496

Merge pull request #3134 from mercedes-benz/feature-3133-restrict-rem…

Merge pull request #3134 from mercedes-benz/feature-3133-restrict-rem… #4496

Workflow file for this run

# SPDX-License-Identifier: MIT
name: Java & Go CI
on:
push:
branches-ignore:
# We do NOT build github action development branches here (because no Java or Go code is changed)
- 'gha_*'
# 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@0ad4b8fadaa221de15dcec353f45205ec38ea70b
- name: Set up JDK 17
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
with:
java-version: 17
distribution: temurin
- name: Set up Gradle
uses: gradle/gradle-build-action@4c39dd82cd5e1ec7c6fa0173bb41b4b6bb3b86ff
with:
cache-read-only: false
- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
with:
go-version: 1.21.6
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
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-integrationtest:integrationtest :sechub-systemtest: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@5d5d22a31266ced268874388b861e4b58bb5c2f3
with:
name: combined-sechub-testreport
path: build/reports/combined-report
retention-days: 14
- name: Archive sechub server artifacts
if: always()
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
with:
name: sechub-server
path: sechub-server/build/libs
retention-days: 14
- name: Archive pds server artifacts
if: always()
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
with:
name: sechub-pds
path: sechub-pds/build/libs
- name: Archive pds tools artifacts
if: always()
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
with:
name: sechub-pds-tools
path: sechub-pds-tools/build/libs
- name: Archive developer tools artifacts
if: always()
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
with:
name: sechub-developertools
path: sechub-developertools/build/libs
retention-days: 14
- name: Archive sechub client artifacts
if: always()
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
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@5d5d22a31266ced268874388b861e4b58bb5c2f3
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@5d5d22a31266ced268874388b861e4b58bb5c2f3
with:
name: sechub-api-spec
path: sechub-doc/build/api-spec/
retention-days: 14