From b744cebbcd6d044f97ee3532bd692ab6c307b2a9 Mon Sep 17 00:00:00 2001 From: Andrzej Stencel Date: Tue, 13 Feb 2024 17:32:19 +0100 Subject: [PATCH 1/3] update actions to v4 --- .github/workflows/build-and-test.yml | 22 +++++++++++----------- .github/workflows/e2e-tests.yml | 8 ++++---- .github/workflows/load-tests.yml | 10 +++++----- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 9df57956cc43..7218e6c1e8cb 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -287,7 +287,7 @@ jobs: - name: Run Unit Tests With Coverage if: startsWith( matrix.go-version, '1.21' ) # only run coverage on one version run: make gotest-with-cover GROUP=${{ matrix.group }} - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: startsWith( matrix.go-version, '1.21' ) # only upload artifact for one version with: name: coverage-artifacts @@ -313,7 +313,7 @@ jobs: needs: [unittest] steps: - uses: actions/checkout@v4 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: coverage-artifacts - name: Upload coverage report @@ -502,7 +502,7 @@ jobs: - name: Build Collector ${{ matrix.binary }} run: make GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} GOARM=${{ matrix.arm }} otelcontribcol - name: Upload Collector Binaries - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: collector-binaries path: ./bin/* @@ -525,7 +525,7 @@ jobs: - name: Install fpm run: gem install --no-document fpm -v 1.15.1 - name: Download Collector Binaries - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: collector-binaries path: bin/ @@ -549,7 +549,7 @@ jobs: ./internal/buildscripts/packaging/fpm/test.sh dist/otel-contrib-collector*x86_64.rpm examples/demo/otel-collector-config.yaml fi - name: Upload Packages - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: collector-packages path: ./dist/* @@ -562,7 +562,7 @@ jobs: with: fetch-depth: 0 - name: Download Binaries - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: collector-binaries path: ./bin/ @@ -584,7 +584,7 @@ jobs: - name: Validate MSI run: .\internal\buildscripts\packaging\msi\make.ps1 Confirm-MSI - name: Upload MSI - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: collector-packages path: ./dist/*.msi @@ -595,12 +595,12 @@ jobs: steps: - uses: actions/checkout@v4 - name: Download Binaries - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: collector-binaries path: ./bin/ - name: Download Packages - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: collector-packages path: ./dist/ @@ -636,13 +636,13 @@ jobs: if: steps.go-cache.outputs.cache-hit != 'true' run: make install-tools - name: Download Binaries - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: collector-binaries path: ./bin/ - run: chmod +x bin/* - name: Download Packages - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: collector-packages path: ./dist/ diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index c7c554ada9be..1bf740cbcef3 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -39,7 +39,7 @@ jobs: - name: Build Collector run: make otelcontribcol - name: Upload Collector Binary - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: collector-binary path: ./bin/* @@ -66,7 +66,7 @@ jobs: if: steps.go-cache.outputs.cache-hit != 'true' run: make -j2 gomoddownload - name: Download Collector Binary - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: collector-binary path: bin/ @@ -104,7 +104,7 @@ jobs: run: | docker save otelcontribcol:latest > /tmp/otelcontribcol.tar - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: otelcontribcol path: /tmp/otelcontribcol.tar @@ -155,7 +155,7 @@ jobs: run: | kubectl get csr -o=jsonpath='{range.items[?(@.spec.signerName=="kubernetes.io/kubelet-serving")]}{.metadata.name}{" "}{end}' | xargs kubectl certificate approve - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: otelcontribcol path: /tmp diff --git a/.github/workflows/load-tests.yml b/.github/workflows/load-tests.yml index 3dde89852748..61f2ee2ba449 100644 --- a/.github/workflows/load-tests.yml +++ b/.github/workflows/load-tests.yml @@ -46,7 +46,7 @@ jobs: run: make install-tools - run: make oteltestbedcol - name: Upload Collector Binaries - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: collector-binaries path: ./bin/* @@ -84,7 +84,7 @@ jobs: run: make install-tools - run: mkdir -p results && touch results/TESTRESULTS.md - name: Download Collector Binaries - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: collector-binaries path: bin/ @@ -103,12 +103,12 @@ jobs: - name: Upload Test Results if: ${{ failure() || success() }} continue-on-error: true - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: ./*.tar - run: cp testbed/tests/results/benchmarks.json testbed/tests/results/${{steps.filename.outputs.name}}.json - name: Upload benchmarks.json - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: benchmark-results path: testbed/tests/results/${{steps.filename.outputs.name}}.json @@ -123,7 +123,7 @@ jobs: if: github.event_name != 'pull_request' steps: - uses: actions/checkout@v4 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: benchmark-results path: results From 3cfc3f3fd24470883496bcc72647dff85b98320a Mon Sep 17 00:00:00 2001 From: Andrzej Stencel Date: Tue, 13 Feb 2024 21:09:34 +0100 Subject: [PATCH 2/3] make artifact names unique This prevents failures after updating the upload-artifact action to v4. --- .github/workflows/build-and-test.yml | 10 ++++++---- .github/workflows/load-tests.yml | 8 ++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 7218e6c1e8cb..4426a1f28283 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -551,7 +551,7 @@ jobs: - name: Upload Packages uses: actions/upload-artifact@v4 with: - name: collector-packages + name: collector-packages-${{ matrix.package_type }} path: ./dist/* windows-msi: if: false # skip. See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/10113 @@ -586,7 +586,7 @@ jobs: - name: Upload MSI uses: actions/upload-artifact@v4 with: - name: collector-packages + name: collector-packages-msi path: ./dist/*.msi publish-check: @@ -602,8 +602,9 @@ jobs: - name: Download Packages uses: actions/download-artifact@v4 with: - name: collector-packages + merge-multiple: true path: ./dist/ + pattern: collector-packages-* - name: Verify Distribution Files Exist id: check run: ./.github/workflows/scripts/verify-dist-files-exist.sh @@ -644,8 +645,9 @@ jobs: - name: Download Packages uses: actions/download-artifact@v4 with: - name: collector-packages + merge-multiple: true path: ./dist/ + pattern: collector-packages-* - name: Add Permissions to Tool Binaries run: chmod -R +x ./dist - name: Verify Distribution Files Exist diff --git a/.github/workflows/load-tests.yml b/.github/workflows/load-tests.yml index 61f2ee2ba449..79b5f952b3bf 100644 --- a/.github/workflows/load-tests.yml +++ b/.github/workflows/load-tests.yml @@ -45,10 +45,10 @@ jobs: if: steps.go-cache.outputs.cache-hit != 'true' run: make install-tools - run: make oteltestbedcol - - name: Upload Collector Binaries + - name: Upload Testbed Binaries uses: actions/upload-artifact@v4 with: - name: collector-binaries + name: testbed-binaries path: ./bin/* - name: Split Loadtest Jobs id: splitloadtest @@ -83,10 +83,10 @@ jobs: if: steps.go-cache.outputs.cache-hit != 'true' run: make install-tools - run: mkdir -p results && touch results/TESTRESULTS.md - - name: Download Collector Binaries + - name: Download Testbed Binaries uses: actions/download-artifact@v4 with: - name: collector-binaries + name: testbed-binaries path: bin/ - run: chmod +x bin/* - name: Loadtest From 5d0d9f4b76bad27f9b87c74eb902cf4d70a10d03 Mon Sep 17 00:00:00 2001 From: Andrzej Stencel Date: Tue, 13 Feb 2024 21:37:28 +0100 Subject: [PATCH 3/3] more fixes to build-and-test workflow artifact names --- .github/workflows/build-and-test.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 4426a1f28283..767f0a487586 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -290,7 +290,7 @@ jobs: - uses: actions/upload-artifact@v4 if: startsWith( matrix.go-version, '1.21' ) # only upload artifact for one version with: - name: coverage-artifacts + name: coverage-artifacts-${{ matrix.go-version }}-${{ matrix.group }} path: ${{ matrix.group }}-coverage.txt unittest: if: ${{ github.actor != 'dependabot[bot]' && always() }} @@ -315,7 +315,8 @@ jobs: - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 with: - name: coverage-artifacts + merge-multiple: true + pattern: coverage-artifacts-* - name: Upload coverage report uses: Wandalen/wretry.action@v1.3.0 with: @@ -504,7 +505,7 @@ jobs: - name: Upload Collector Binaries uses: actions/upload-artifact@v4 with: - name: collector-binaries + name: collector-binaries-${{ matrix.os }}-${{ matrix.arch }} path: ./bin/* build-package: @@ -527,8 +528,9 @@ jobs: - name: Download Collector Binaries uses: actions/download-artifact@v4 with: - name: collector-binaries + merge-multiple: true path: bin/ + pattern: collector-binaries-* - run: chmod +x bin/* - name: Set Release Tag id: github_tag @@ -564,8 +566,9 @@ jobs: - name: Download Binaries uses: actions/download-artifact@v4 with: - name: collector-binaries + merge-multiple: true path: ./bin/ + pattern: collector-binaries-* - name: Cache Wix id: wix-cache uses: actions/cache@v3 @@ -597,8 +600,9 @@ jobs: - name: Download Binaries uses: actions/download-artifact@v4 with: - name: collector-binaries + merge-multiple: true path: ./bin/ + pattern: collector-binaries-* - name: Download Packages uses: actions/download-artifact@v4 with: @@ -639,8 +643,9 @@ jobs: - name: Download Binaries uses: actions/download-artifact@v4 with: - name: collector-binaries + merge-multiple: true path: ./bin/ + pattern: collector-binaries-* - run: chmod +x bin/* - name: Download Packages uses: actions/download-artifact@v4