From edf25a1986e979ca0f7a1ae89bf74b27b121e5fa Mon Sep 17 00:00:00 2001 From: mafasva <156201303+mafasva@users.noreply.github.com> Date: Wed, 7 Feb 2024 14:54:04 +0100 Subject: [PATCH] Feature/add nightly without sonar (#459) * Add first github workflow file (nightly) * update first github workflow triggert by push event * update first github workflow deactivate int tests and cirlceCi pipline * update first github workflow remove Int Test folder * update first github workflow add Int Test folder * update first github workflow add Int Test again * update first github workflow schedule job * update first github workflow schedule job I * add nightly as github workflow * disable sonar --- .circleci/config.yml | 8 +++--- .github/workflows/nightly.yml | 54 +++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/nightly.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 6cfb562c9..94162d24e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,7 +18,7 @@ workflows: build_and_test: jobs: - test: - context: + context: - org-global - ms_teams - tag-version: @@ -68,7 +68,7 @@ jobs: path: ~/test-results/unit-tests/ - store_test_results: path: ~/test-results/integration-tests/ - - sonarcloud/scan +# - sonarcloud/scan - cache-in-maven-dependencies - jq/install - run: @@ -133,7 +133,7 @@ jobs: ) echo "$MS_TEAMS_MSG_TEMPLATE" > /tmp/ms_teams_message when: always - - run: + - run: name: Report Build Success command: | MSG_PATH=/tmp/ms_teams_success_message @@ -146,7 +146,7 @@ jobs: MSG_PATH=/tmp/ms_teams_failure_message sed -e 's/__build_status__/Failed/' -e 's/__theme_color__/e2091d/' /tmp/ms_teams_message > $MSG_PATH curl --fail -H "Content-Type: application/json" --data-binary @$MSG_PATH $CODEX_NOTIFICATIONS - when: on_fail + when: on_fail tag-version: docker: - image: cimg/openjdk:17.0.8 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 000000000..2b5e2e47f --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,54 @@ +name: nightly test run +on: + schedule: + - cron: '0 22 * * *' + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: 'maven' + - name: Run unit tests + run: mvn clean test + - name: Run integration tests + run: mvn verify -P integration-tests + - name: Save test results + run: | + mkdir -p ~/test-results/unit-tests/ + mkdir -p ~/test-results/integration-tests/ + find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/unit-tests/ \; + find . -type f -regex ".*/target/failsafe-reports/.*xml" -exec cp {} ~/test-results/integration-tests/ \; + - name: Run CVE scan + run: mvn dependency-check:check + - name: Upload test coverage report + uses: actions/upload-artifact@v4 + with: + name: test-coverage-report + path: target/site/jacoco-merged-test-coverage-report + - name: Upload dependency check report + uses: actions/upload-artifact@v4 + with: + name: dependency-check-report + path: target/dependency-check-report.html + - name: Upload unit tests report + uses: actions/upload-artifact@v4 + with: + name: unit-tests-report + path: ~/test-results/unit-tests/ + - name: Upload integration tests report + uses: actions/upload-artifact@v4 + with: + name: integration-tests-report + path: ~/test-results/integration-tests/ + #- name: SonarCloud Scan + # uses: sonarsource/sonarcloud-github-action@v2.1.1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}