Skip to content

Commit

Permalink
Merge branch 'mercedes-benz:develop' into feature-345-summary-in-reports
Browse files Browse the repository at this point in the history
  • Loading branch information
zigfridus authored Nov 22, 2023
2 parents 02fdfa5 + caae24b commit aaeeedd
Show file tree
Hide file tree
Showing 91 changed files with 1,435 additions and 753 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/_build+publish-pds-solution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:
echo "pds-version '${{ inputs.pds-version }}'"
- name: Checkout git repository
uses: actions/checkout@v4
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Docker login to ghcr.io
uses: docker/login-action@v3
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand Down
123 changes: 123 additions & 0 deletions .github/workflows/documentation-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# SPDX-License-Identifier: MIT
name: Documentation build

on:
workflow_dispatch:
inputs:
publish-documentation:
description: Insert your email address here if you want to create a PR for Github pages update (branch `master`)
required: false
schedule:
# Nightly build documentation:
# cron runs on the default branch: `develop` in our case.
- cron: '32 23 * * *'

env:
ACTIONS_SECHUB_DOC_RELEASE_BRANCH: master

jobs:
build-documentation:
name: build documentation
runs-on: ubuntu-latest
steps:
- name: "Show + check Input and git branch"
run: |
echo "git branch: '${{ github.ref_name }}'"
echo "publish-documentation: '${{ inputs.publish-documentation }}'"
if [ '${{ inputs.publish-documentation }}' != '' -a '${{ github.ref_name }}' != "$ACTIONS_SECHUB_DOC_RELEASE_BRANCH" ] ; then
echo "Aborting run because publishing the documentation must be done on branch '$ACTIONS_SECHUB_DOC_RELEASE_BRANCH'"
echo "Tip: Run this action again and select branch '$ACTIONS_SECHUB_DOC_RELEASE_BRANCH'"
exit 1
fi
- name: Git checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-tags: true
fetch-depth: 0

- 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: Install graphviz (asciidoc diagrams)
run: sudo apt-get --assume-yes install graphviz

# -----------------------------------------
# Build documentation
# -----------------------------------------
- name: Complete build with documentation
run: ./buildDoc

# -----------------------------------------
# Upload documentation
# -----------------------------------------
- name: Archive documentation HTML
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: sechub-docs-html
path: sechub-doc/build/docs/final-html/
retention-days: 14

- name: Archive documentation PDF
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: sechub-docs-pdf
path: sechub-doc/build/docs/asciidoc/*.pdf
retention-days: 14

# -----------------------------------------
# Update and commit documentation for https://mercedes-benz.github.io/sechub/
# -----------------------------------------
- name: Update documentation - publish and commit
if: (inputs.publish-documentation != '') && (github.ref_name == env.ACTIONS_SECHUB_DOC_RELEASE_BRANCH)
run: |
git config user.name "$GITHUB_TRIGGERING_ACTOR (via github-actions)"
git config user.email "${{ inputs.publish-documentation }}"
git reset --hard
sechub-doc/helperscripts/publish+git-add-releasedocs.sh
git commit -m "docs update by '$GITHUB_TRIGGERING_ACTOR' (via github-actions)"
# -----------------------------------------
# Create pull request for documentation update
# -----------------------------------------
- name: Update documentation - Create pull request
if: (inputs.publish-documentation != '') && (github.ref_name == env.ACTIONS_SECHUB_DOC_RELEASE_BRANCH)
id: pr_release_documentation
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38
with:
branch: release-documentation
branch-suffix: short-commit-hash
delete-branch: true
title: '1 - Release documentation [auto-generated]'
body: |
Release of SecHub documentation
-> Please review before merge.
- name: Update documentation - Print PR infos
if: (inputs.publish-documentation != '') && (github.ref_name == env.ACTIONS_SECHUB_DOC_RELEASE_BRANCH)
run: |
echo "Pull Request Number - ${{ steps.pr_release_documentation.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.pr_release_documentation.outputs.pull-request-url }}"
4 changes: 2 additions & 2 deletions .github/workflows/github-action-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Use Node.js
# We do not define a dedicated node version here, we just use the default environment
# which should be the default environment for the github actions runtime as well
uses: actions/setup-node@v3
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65

- name: Clean install
run: npm ci
Expand Down
58 changes: 22 additions & 36 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,25 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0
with:
java-version: 17
distribution: temurin
cache: gradle

- name: Set up Gradle
uses: gradle/gradle-build-action@842c587ad8aa4c68eeba24c396e15af4c2e9f30a
with:
cache-read-only: false

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
go-version: 1.20.4

- uses: actions/cache@v3.3.2
- uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: |
~/.cache/go-build
Expand Down Expand Up @@ -68,78 +72,60 @@ jobs:
# -----------------------------------------
- name: Archive combined test report
if: always()
uses: actions/upload-artifact@v3
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@v3
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@v3
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@v3
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@v3
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@v3
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: sechub-client
path: sechub-cli/build/go
retention-days: 14

- name: Install graphviz (asciidoc diagrams)
run: sudo apt-get -qq --assume-yes install graphviz

# -----------------------------------------
# Build Documentation
# -----------------------------------------
- name: Create documentation
run: ./gradlew documentation -Dsechub.build.stage=all

# -----------------------------------------
# Upload documentation
# -----------------------------------------
- name: Archive documentation HTML
uses: actions/upload-artifact@v3
with:
name: sechub-docs-html
path: sechub-doc/build/docs/final-html/
retention-days: 14

- name: Archive documentation PDF
- name: Archive sechub integration test report artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: sechub-docs-pdf
path: sechub-doc/build/docs/asciidoc/*.pdf
name: sechub-integrationtest-test-reports
path: sechub-integrationtest/build/sechub-test-reports
retention-days: 14

- name: Archive documentation openAPI3
uses: actions/upload-artifact@v3
- name: Archive openAPI3 JSON files
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: sechub-api-spec
path: sechub-doc/build/api-spec/
Expand Down
26 changes: 15 additions & 11 deletions .github/workflows/publish-libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout master
uses: actions/checkout@v4
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
ref: master
# Create temporary local tags, so we build documentation for this tag...
Expand All @@ -28,11 +28,15 @@ jobs:

# Build
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0
with:
java-version: 17
distribution: temurin
cache: gradle

- name: Set up Gradle
uses: gradle/gradle-build-action@842c587ad8aa4c68eeba24c396e15af4c2e9f30a
with:
cache-read-only: false

- name: Build
run: ./gradlew clean build -x :sechub-integrationtest:test -x :sechub-cli:build
Expand All @@ -51,40 +55,40 @@ jobs:
# -----------------------------------------
- name: Archive combined test report
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: combined-sechub-testreport
path: build/reports/combined-report
retention-days: 14
- name: Archive GIT status
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: git-status.txt
path: build/reports/git-status.txt
retention-days: 14

# -----------------------------------------
# Assert releaseable, so no dirty flags on releases
# even when all artifact creation parts are done!
# -----------------------------------------
- name: Assert releasable
run: ./gradlew assertReleaseable

# **************************************************
# Now let's create + publish a new LIBRARIES release
# **************************************************

# Publish to github packages
# Publish to github packages
- name: Publish
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token

# Create release
- name: Create libraries release
id: create_libraries_release
uses: actions/create-release@v1
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
Expand All @@ -97,4 +101,4 @@ jobs:
For details about changes look at [Milestone ${{github.event.inputs.milestone-number}}]( https://github.com/mercedes-benz/sechub/milestone/${{github.event.inputs.milestone-number}}?closed=1)
draft: false
prerelease: false

Loading

0 comments on commit aaeeedd

Please sign in to comment.