From 7e7308973591688a6e87f547b4b76c5f5a52c283 Mon Sep 17 00:00:00 2001 From: Markus Petke Date: Wed, 31 Jan 2024 09:13:17 +0100 Subject: [PATCH] update all actions (#49) * update all actions * fix artifacts * fix java action --- .github/workflows/ci.yml | 4 +- src/app/workflows/build-docker-image.yml | 26 ++++++------ src/app/workflows/build-multiarch-image.yml | 2 +- src/common/workflows/check-devcontainer.yml | 4 +- src/common/workflows/check-licenses.yml | 9 +++-- src/common/workflows/ensure-lifecycle.yml | 2 +- src/common/workflows/gen-desired-state.yml | 6 +-- src/cpp-app/workflows/ci.yml | 4 +- src/cpp-app/workflows/release.yml | 16 ++++---- src/cpp-sdk/workflows/ci.yml | 4 +- src/cpp-sdk/workflows/sdk-build-container.yml | 12 +++--- .../actions/pre-commit-action/action.yml | 2 +- src/python-app/workflows/ci.yml | 40 ++++++++++++------- src/python-app/workflows/release.yml | 18 ++++----- src/python-sdk/workflows/ci.yaml | 4 +- src/python-sdk/workflows/codeql-analysis.yml | 2 +- src/python-sdk/workflows/release.yaml | 6 +-- 17 files changed, 86 insertions(+), 75 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68051c7..5f9d1bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,10 +39,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Checkout template repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: eclipse-velocitas/vehicle-app-${{ matrix.language }}-template path: test/${{ matrix.language }}/repo diff --git a/src/app/workflows/build-docker-image.yml b/src/app/workflows/build-docker-image.yml index 3ea24e2..67dd949 100644 --- a/src/app/workflows/build-docker-image.yml +++ b/src/app/workflows/build-docker-image.yml @@ -34,25 +34,25 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "recursive" - name: Clone Release Documentation Action repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: eclipse-velocitas/release-documentation-action path: "./.github/actions" - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - id: github-repository-name-case-adjusted name: Prepare repository name in lower case for docker upload. This supports repository names in mixed case - uses: ASzc/change-string-case-action@v5 + uses: ASzc/change-string-case-action@v6 with: string: ${{ github.repository }} @@ -86,7 +86,7 @@ jobs: - name: "${{ env.APP_NAME }} -- Build image" id: image_build - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: provenance: false pull: true @@ -139,14 +139,14 @@ jobs: - name: "${{ env.APP_NAME }} -- Upload trivy report as artifacts" if: ${{ always() && steps.image_build.outcome == 'success' }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: test-results + name: test-results-trivy path: | results/Documentation/renderer/* - name: "${{ env.APP_NAME }} -- Publish Trivy Scan Results" - uses: mikepenz/action-junit-report@v3 + uses: mikepenz/action-junit-report@v4 if: ${{ always() && steps.image_build.outcome == 'success' }} with: check_name: Trivy Scan Results (${{ env.APP_NAME }}) @@ -157,7 +157,7 @@ jobs: - name: "${{ env.APP_NAME }} -- Upload image to artifacts" if: ${{ steps.image_build.outcome == 'success' }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 env: VAPP_IMAGE: ${{ env.APP_NAME }}-${{ inputs.platform }} with: @@ -167,7 +167,7 @@ jobs: - name: "${{ env.APP_NAME }} -- Upload AppManifest.json to artifacts" if: ${{ steps.image_build.outcome == 'success' }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: AppManifest path: ./app/AppManifest.json @@ -179,7 +179,7 @@ jobs: - name: "${{ env.APP_NAME }} -- Upload generated podspec.yaml" if: ${{ steps.image_build.outcome == 'success' }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Podspec path: ./podspec.yaml @@ -191,7 +191,7 @@ jobs: - name: "${{ env.APP_NAME }} -- Upload generated helm chart" if: ${{ steps.image_build.outcome == 'success' }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: HelmChart path: ./helm diff --git a/src/app/workflows/build-multiarch-image.yml b/src/app/workflows/build-multiarch-image.yml index 26007fa..a7aa3bb 100644 --- a/src/app/workflows/build-multiarch-image.yml +++ b/src/app/workflows/build-multiarch-image.yml @@ -30,7 +30,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Get app-name id: export-app-name diff --git a/src/common/workflows/check-devcontainer.yml b/src/common/workflows/check-devcontainer.yml index a2f7fe1..c55eeae 100644 --- a/src/common/workflows/check-devcontainer.yml +++ b/src/common/workflows/check-devcontainer.yml @@ -32,7 +32,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build devcontainer and run automated tests uses: devcontainers/ci@v0.3 @@ -42,7 +42,7 @@ jobs: pytest -sx .devcontainer/tests - name: Upload logs - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: name: logs diff --git a/src/common/workflows/check-licenses.yml b/src/common/workflows/check-licenses.yml index 67c32fb..00feacf 100644 --- a/src/common/workflows/check-licenses.yml +++ b/src/common/workflows/check-licenses.yml @@ -33,10 +33,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Clone License Check Repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: eclipse-velocitas/license-check ref: v1.2.3 @@ -51,8 +51,9 @@ jobs: generate-dash: true - name: Setup Java JDK - uses: actions/setup-java@v1.4.4 + uses: actions/setup-java@v4 with: + distribution: 'temurin' java-version: 11.0.19 - name: Run dash @@ -63,7 +64,7 @@ jobs: java -jar dash.jar clearlydefined.input -summary DEPENDENCIES - name: Upload dash input/output as artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: name: "dash-artifacts" diff --git a/src/common/workflows/ensure-lifecycle.yml b/src/common/workflows/ensure-lifecycle.yml index 02547e5..05e8583 100644 --- a/src/common/workflows/ensure-lifecycle.yml +++ b/src/common/workflows/ensure-lifecycle.yml @@ -31,7 +31,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Run CLI run: | diff --git a/src/common/workflows/gen-desired-state.yml b/src/common/workflows/gen-desired-state.yml index a731ede..49aa966 100644 --- a/src/common/workflows/gen-desired-state.yml +++ b/src/common/workflows/gen-desired-state.yml @@ -28,9 +28,9 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.10" @@ -45,7 +45,7 @@ jobs: - id: github-repository-name-case-adjusted name: Prepare repository name in lower case for docker upload. - uses: ASzc/change-string-case-action@v5 + uses: ASzc/change-string-case-action@v6 with: string: ${{ github.repository }} diff --git a/src/cpp-app/workflows/ci.yml b/src/cpp-app/workflows/ci.yml index 4aa1eff..c45c4bf 100644 --- a/src/cpp-app/workflows/ci.yml +++ b/src/cpp-app/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: name: "Build, Test and Lint" steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "recursive" @@ -80,7 +80,7 @@ jobs: output: both - name: Upload test-results as artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: test-results path: | diff --git a/src/cpp-app/workflows/release.yml b/src/cpp-app/workflows/release.yml index 7cbb62d..b591535 100644 --- a/src/cpp-app/workflows/release.yml +++ b/src/cpp-app/workflows/release.yml @@ -28,7 +28,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Get app-name id: export-app-name @@ -51,7 +51,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - id: get_version uses: battila7/get-version-action@v2 @@ -59,7 +59,7 @@ jobs: - run: echo "Using VehicleApp version ${{ steps.get_version.outputs.version-without-v }} from tag" - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -67,7 +67,7 @@ jobs: - id: github-repository-name-case-adjusted name: Prepare repository name in lower case for docker upload. - uses: ASzc/change-string-case-action@v5 + uses: ASzc/change-string-case-action@v6 with: string: ${{ github.repository }} @@ -80,7 +80,7 @@ jobs: intervalSeconds: 20 - name: Download builds from Build multiarch image workflow artifacts - uses: dawidd6/action-download-artifact@v2 + uses: dawidd6/action-download-artifact@v3 with: github_token: ${{secrets.GITHUB_TOKEN}} workflow: build-multiarch-image.yml @@ -118,9 +118,9 @@ jobs: name: Generate release documentation runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: "18" check-latest: true @@ -142,7 +142,7 @@ jobs: intervalSeconds: 30 - name: Download artifact from CI workflow - uses: dawidd6/action-download-artifact@v2 + uses: dawidd6/action-download-artifact@v3 with: workflow: ci.yml workflow_conclusion: success diff --git a/src/cpp-sdk/workflows/ci.yml b/src/cpp-sdk/workflows/ci.yml index 29b3166..f46d2f1 100644 --- a/src/cpp-sdk/workflows/ci.yml +++ b/src/cpp-sdk/workflows/ci.yml @@ -33,10 +33,10 @@ jobs: name: "Build, Test and Lint" steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Clone vehicle_model repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: eclipse-velocitas/vehicle-model-cpp path: "./app/vehicle_model" diff --git a/src/cpp-sdk/workflows/sdk-build-container.yml b/src/cpp-sdk/workflows/sdk-build-container.yml index 088d29a..bf6ad65 100644 --- a/src/cpp-sdk/workflows/sdk-build-container.yml +++ b/src/cpp-sdk/workflows/sdk-build-container.yml @@ -33,18 +33,18 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 with: version: v0.9.0 - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -52,14 +52,14 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: | ghcr.io/${{ github.repository }} - name: "Build image" id: image_build - uses: docker/build-push-action@v3.2.0 + uses: docker/build-push-action@v5 with: push: true file: sdk/Dockerfile diff --git a/src/python-app/actions/pre-commit-action/action.yml b/src/python-app/actions/pre-commit-action/action.yml index b2abc98..cd066af 100644 --- a/src/python-app/actions/pre-commit-action/action.yml +++ b/src/python-app/actions/pre-commit-action/action.yml @@ -26,7 +26,7 @@ runs: shell: bash - run: python -m pip freeze --local shell: bash - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: ~/.cache/pre-commit key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} diff --git a/src/python-app/workflows/ci.yml b/src/python-app/workflows/ci.yml index 2565629..a71e355 100644 --- a/src/python-app/workflows/ci.yml +++ b/src/python-app/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - uses: de-vri-es/setup-git-credentials@v2 with: @@ -61,7 +61,7 @@ jobs: uses: ./.github/actions/pre-commit-action - name: Clone Release Documentation Action repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: eclipse-velocitas/release-documentation-action path: "./.github/release-documentation/actions" @@ -77,7 +77,7 @@ jobs: --cov-branch ./app/tests/unit - name: Publish Test Report - uses: mikepenz/action-junit-report@v3 + uses: mikepenz/action-junit-report@v4 if: always() with: report_paths: ./results/UnitTest/junit.xml @@ -116,10 +116,10 @@ jobs: packagePath: results/Documentation/renderer - name: Upload test results as artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: - name: "test-results" + name: "test-results-unit-tests" path: | results/Documentation/renderer/* @@ -131,7 +131,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Get app-name id: export-app-name @@ -154,9 +154,9 @@ jobs: APP_NAME: ${{ needs.get-app-name.outputs.app_name }} steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.10" @@ -171,7 +171,7 @@ jobs: velocitas init - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -194,12 +194,12 @@ jobs: - id: github-repository-name-case-adjusted name: Prepare repository name in lower case for docker upload. This supports repository names in mixed case - uses: ASzc/change-string-case-action@v5 + uses: ASzc/change-string-case-action@v6 with: string: ${{ github.repository }} - name: Download stored image from artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 env: VAPP_IMAGE: ${{ env.APP_NAME }}-amd64 with: @@ -220,7 +220,7 @@ jobs: pytest ./app/tests/integration --override-ini junit_family=xunit1 --junit-xml=./results/IntTest/junit.xml - name: Publish Test Report - uses: mikepenz/action-junit-report@v3 + uses: mikepenz/action-junit-report@v4 if: always() with: report_paths: ./results/IntTest/junit.xml @@ -229,7 +229,7 @@ jobs: annotate_only: true - name: Clone release documentation action repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: eclipse-velocitas/release-documentation-action path: "./.github/actions" @@ -244,9 +244,19 @@ jobs: packagePath: ./results/Documentation/renderer - name: Upload integration test results as artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: - name: "test-results" + name: "test-results-integration-tests" path: | results/Documentation/renderer/* + +merge-test-results: + runs-on: ubuntu-latest + needs: run-integration-tests + steps: + - name: Merge Artifacts + uses: actions/upload-artifact/merge@v4 + with: + name: test-results + pattern: test-results-* diff --git a/src/python-app/workflows/release.yml b/src/python-app/workflows/release.yml index 6003bba..8245369 100644 --- a/src/python-app/workflows/release.yml +++ b/src/python-app/workflows/release.yml @@ -28,7 +28,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Get app-name id: export-app-name @@ -51,7 +51,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - id: get_version uses: battila7/get-version-action@v2 @@ -59,7 +59,7 @@ jobs: - run: echo "Using VehicleApp version ${{ steps.get_version.outputs.version-without-v }} from tag" - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -67,7 +67,7 @@ jobs: - id: github-repository-name-case-adjusted name: Prepare repository name in lower case for docker upload. - uses: ASzc/change-string-case-action@v5 + uses: ASzc/change-string-case-action@v6 with: string: ${{ github.repository }} @@ -80,7 +80,7 @@ jobs: intervalSeconds: 20 - name: Download builds from Build multiarch image workflow artifacts - uses: dawidd6/action-download-artifact@v2 + uses: dawidd6/action-download-artifact@v3 with: github_token: ${{secrets.GITHUB_TOKEN}} workflow: build-multiarch-image.yml @@ -122,15 +122,15 @@ jobs: APP_NAME: ${{ needs.get-app-name.outputs.app_name }} TEST_RESULT_FOLDER_NAME: test-results steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Clone Release Documentation Action repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: eclipse-velocitas/release-documentation-action path: "./.github/actions" - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: "18" check-latest: true @@ -152,7 +152,7 @@ jobs: intervalSeconds: 10 - name: Download artifact from CI workflow - uses: dawidd6/action-download-artifact@v2 + uses: dawidd6/action-download-artifact@v3 with: workflow: ci.yml workflow_conclusion: success diff --git a/src/python-sdk/workflows/ci.yaml b/src/python-sdk/workflows/ci.yaml index 3a5caac..e01bc56 100644 --- a/src/python-sdk/workflows/ci.yaml +++ b/src/python-sdk/workflows/ci.yaml @@ -39,14 +39,14 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Init velocitas project run: | velocitas init - name: Initialize python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: "pip" diff --git a/src/python-sdk/workflows/codeql-analysis.yml b/src/python-sdk/workflows/codeql-analysis.yml index 8b329e9..275f48c 100644 --- a/src/python-sdk/workflows/codeql-analysis.yml +++ b/src/python-sdk/workflows/codeql-analysis.yml @@ -52,7 +52,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/src/python-sdk/workflows/release.yaml b/src/python-sdk/workflows/release.yaml index e37246e..cf5dd18 100644 --- a/src/python-sdk/workflows/release.yaml +++ b/src/python-sdk/workflows/release.yaml @@ -25,10 +25,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Initialize python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.9 @@ -54,7 +54,7 @@ jobs: python3 setup.py sdist - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: release path: ./dist