Use generated openapi client in Github Action #4320 #6291
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-License-Identifier: MIT | |
name: Java & Go CI | |
on: | |
push: | |
branches: | |
- 'develop' | |
- 'hotfix' | |
- 'main' | |
- 'master' | |
paths: | |
- '**' | |
- '!docs/**' | |
- '!github-actions/**' | |
- '!ide-plugins/**' | |
- '!sechub-doc/**' | |
- '!sechub-pds-solutions/**' | |
- '!sechub-solution/**' | |
- '!sechub-website/**' | |
- '!sechub-web-ui/**' | |
- '!sechub-web-ui-solution/**' | |
- '.github/workflows/gradle.yml' | |
pull_request: | |
paths: | |
- '**' | |
- '!docs/**' | |
- '!github-actions/**' | |
- '!ide-plugins/**' | |
- '!sechub-doc/**' | |
- '!sechub-pds-solutions/**' | |
- '!sechub-solution/**' | |
- '!sechub-website/**' | |
- '!sechub-web-ui/**' | |
- '!sechub-web-ui-solution/**' | |
- '.github/workflows/gradle.yml' | |
# enable manual triggering of workflow | |
workflow_dispatch: | |
jobs: | |
build: | |
# Skip run when triggered by a tag | |
if: ${{ github.ref_type != 'tag' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- name: Set up Gradle | |
uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 | |
with: | |
# To prevent a fill-up of the actions cache: | |
# Only write to the cache for builds on the 'master' branch. | |
# Builds on other branches will only read existing entries from the cache. | |
cache-read-only: ${{ github.ref != 'refs/heads/master' }} | |
- name: Set up Go | |
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 | |
with: | |
go-version: 1.24.4 | |
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 | |
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 -x :sechub-cli:build | |
- name: Generate and build Java projects related to SecHub Java API | |
run: ./gradlew :sechub-pds-tools:buildPDSToolsCLI | |
# Integration test | |
- name: Start Integration Test Servers | |
run: ./gradlew :sechub-integrationtest:startIntegrationTestInstances --console=plain | |
- name: Run Integration Tests | |
run: ./gradlew :sechub-integrationtest:integrationtest --console=plain | |
- name: Run System Tests | |
run: ./gradlew :sechub-systemtest:integrationtest --console=plain | |
# We use 'if: always()' to run a step even if a previous step failed | |
- name: Stop Integration Test Servers | |
if: always() | |
run: ./gradlew :sechub-integrationtest:stopIntegrationTestInstances --console=plain | |
- name: Create combined test report | |
if: always() | |
run: ./gradlew createCombinedTestReport | |
# ----------------------------------------- | |
# Upload Build Artifacts | |
# ----------------------------------------- | |
- name: Archive combined test report | |
if: always() | |
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 | |
with: | |
name: combined-sechub-testreport | |
path: build/reports/combined-report | |
retention-days: 14 | |
- name: Archive sechub server artifacts | |
if: always() | |
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 | |
with: | |
name: sechub-server | |
path: sechub-server/build/libs | |
retention-days: 14 | |
- name: Archive pds server artifacts | |
if: always() | |
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 | |
with: | |
name: sechub-pds | |
path: sechub-pds/build/libs | |
- name: Archive pds tools artifacts | |
if: always() | |
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 | |
with: | |
name: sechub-pds-tools | |
path: sechub-pds-tools/build/libs | |
- name: Archive developer tools artifacts | |
if: always() | |
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 | |
with: | |
name: sechub-developertools | |
path: sechub-developertools/build/libs | |
retention-days: 14 | |
- name: Archive sechub client artifacts | |
if: always() | |
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 | |
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@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 | |
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@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 | |
with: | |
name: sechub-api-spec | |
path: sechub-doc/build/api-spec/ | |
retention-days: 14 |