Skip to content

Commit

Permalink
CI: FIx fail to upload multiple artifacts with the same name
Browse files Browse the repository at this point in the history
Signed-off-by: Cyclinder Kuo <kuocyclinder@gmail.com>
  • Loading branch information
cyclinder committed Dec 25, 2024
1 parent abf8405 commit 28236cd
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 32 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/auto-upgrade-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,15 @@ jobs:
if: ${{ needs.get_ref.outputs.build_old_image_tag == 'true' }}
uses: actions/download-artifact@v4.1.8
with:
name: old-image-tar-spiderpool-agent
path: test/.download
pattern: old-image-tar-spiderpool-agent-${{ needs.call_build_old_ci_image.outputs.imageTag }}

- name: Download old spiderpool-controller image with tag ${{ needs.call_build_old_ci_image.outputs.imageTag }}
if: ${{ needs.get_ref.outputs.build_old_image_tag == 'true' }}
uses: actions/download-artifact@v4.1.8
with:
name: old-image-tar-spiderpool-controller
path: test/.download
pattern: old-image-tar-spiderpool-controller-${{ needs.call_build_old_ci_image.outputs.imageTag }}

- name: Load Images
if: ${{ needs.get_ref.outputs.build_old_image_tag == 'true' }}
Expand Down Expand Up @@ -306,14 +306,14 @@ jobs:
- name: Download new spiderpool-agent image with tag ${{ needs.call_build_new_ci_image.outputs.imageTag }}
uses: actions/download-artifact@v4.1.8
with:
name: new-image-tar-spiderpool-agent
path: test/.download
pattern: new-image-tar-spiderpool-agent-${{ needs.call_build_old_ci_image.outputs.imageTag }}

- name: Download new spiderpool-controller image with tag ${{ needs.call_build_new_ci_image.outputs.imageTag }}
uses: actions/download-artifact@v4.1.8
with:
name: new-image-tar-spiderpool-controller
path: test/.download
pattern: new-image-tar-spiderpool-controller-${{ needs.call_build_old_ci_image.outputs.imageTag }}

- name: Load Images with tag ${{ needs.call_build_new_ci_image.outputs.imageTag }}
run: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/build-image-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
if: ${{ env.exists == 'false' }}
uses: actions/upload-artifact@v4.5.0
with:
name: image-digest ${{ env.IMAGE_NAME }}
name: image-digest-${{ env.IMAGE_NAME }}-${{ env.tag }}
path: image-digest
retention-days: 1

Expand All @@ -151,6 +151,8 @@ jobs:
uses: actions/download-artifact@v4.1.8
with:
path: image-digest/
pattern: image-digest-${{ env.IMAGE_NAME }}-${{ env.tag }}
merge-multiple: true

- name: Image Digests Output
shell: bash
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-image-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,15 @@ jobs:
- name: Upload artifact digests
uses: actions/upload-artifact@v4.5.0
with:
name: image-digest-${{ matrix.name }}
name: image-digest-${{ matrix.name }}-${{ env.tag }}
path: image-digest
retention-days: 1

# Upload artifact race images tar
- name: Upload artifact race image tar
uses: actions/upload-artifact@v4.5.0
with:
name: ${{ inputs.imageTarName }}-${{ matrix.name }}
name: ${{ inputs.imageTarName }}-${{ matrix.name }}-${{ env.tag }}
path: /tmp/${{ matrix.name }}-race.tar
retention-days: 1

Expand Down Expand Up @@ -303,14 +303,14 @@ jobs:
- name: Download digests of all images built
uses: actions/download-artifact@v4.1.8
with:
pattern: image-digest-spiderpool-agent-*
path: image-digest/
name: image-digest-spiderpool-agent

- name: Download digests of all images built
uses: actions/download-artifact@v4.1.8
with:
pattern: image-digest-spiderpool-controller-*
path: image-digest/
name: image-digest-spiderpool-controller

- name: Image Digests Output
shell: bash
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/build-image-plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
if: ${{ env == 'false' }}
uses: actions/upload-artifact@v4.5.0
with:
name: image-digest ${{ env.IMAGE_NAME }}
name: image-digest-${{ env.IMAGE_NAME }}-${{ steps.arg.outputs.image_tag }}
path: image-digest
retention-days: 1

Expand All @@ -151,6 +151,8 @@ jobs:
uses: actions/download-artifact@v4.1.8
with:
path: image-digest/
pattern: image-digest-*
merge-multiple: true

- name: Image Digests Output
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/call-release-changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
- name: Upload Changelog
uses: actions/upload-artifact@v4.5.0
with:
name: changelog_artifact
name: changelog_artifact_${{ env.RUN_dest_tag }}
path: ${{ env.FILE_PATH }}
retention-days: 1
if-no-files-found: error
Expand All @@ -128,7 +128,7 @@ jobs:
- name: Download Artifact
uses: actions/download-artifact@v4.1.8
with:
name: changelog_artifact
pattern: changelog_artifact_${{ env.RUN_dest_tag }}
path: ${{ env.DEST_DIRECTORY }}

- uses: crazy-max/ghaction-import-gpg@v6
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/call-release-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
- name: Upload Artifact
uses: actions/upload-artifact@v4.5.0
with:
name: chart_package_artifact
name: chart_package_artifact_${{ needs.get_ref.outputs.ref }}
path: tmp/*
retention-days: 1
if-no-files-found: error
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
- name: Download Artifact
uses: actions/download-artifact@v4.1.8
with:
name: chart_package_artifact
pattern: chart_package_artifact_${{ needs.get_ref.outputs.ref }}
path: charts/

- name: Update Chart Yaml
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/call-release-doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ jobs:
- name: Upload Artifact
uses: actions/upload-artifact@v4.5.0
with:
name: website_package_artifact
name: website_package_artifact_${{ env.REF }}
path: site.tar.gz
retention-days: 0
if-no-files-found: error
Expand All @@ -154,7 +154,9 @@ jobs:
- name: Download Artifact
uses: actions/download-artifact@v4.1.8
with:
name: website_package_artifact
pattern: website_package_artifact_${{ env.REF }}
path: ./
merge-multiple: true

- name: Untar Doc
run: |
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/e2e-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,16 @@ jobs:
- name: Download spiderpool-agent image
uses: actions/download-artifact@v4.1.8
with:
name: image-tar-spiderpool-agent
path: test/.download
pattern: image-tar-spiderpool-agent-${{ inputs.ref }}
merge-multiple: true

- name: Download spiderpool-controller image
uses: actions/download-artifact@v4.1.8
with:
name: image-tar-spiderpool-controller
path: test/.download
pattern: image-tar-spiderpool-controller-${{ inputs.ref }}
merge-multiple: true

- name: Load Images
run: |
Expand Down Expand Up @@ -179,7 +181,7 @@ jobs:
if: ${{ env.RUN_SETUP_KIND_CLUSTER_PASS == 'false' && env.UPLOAD_SETUP_KIND_CLUSTER_LOG == 'true' }}
uses: actions/upload-artifact@v4.5.0
with:
name: ${{ inputs.os }}-${{ inputs.ip_family }}-${{ matrix.e2e_test_mode }}-${{ inputs.k8s_version }}-setupkind.txt
name: ${{ inputs.os }}-${{ inputs.ip_family }}-${{ matrix.e2e_test_mode }}-${{ inputs.k8s_version }}-${{ inputs.image_tag }}-setupkind.txt
path: test/e2edebugLog.txt
retention-days: 7

Expand Down Expand Up @@ -225,15 +227,15 @@ jobs:
if: ${{ inputs.run_e2e == 'true' }}
uses: actions/upload-artifact@v4.5.0
with:
name: ${{ inputs.os }}-${{ inputs.ip_family }}-${{ matrix.e2e_test_mode }}-${{ inputs.k8s_version }}-debuglog.txt
name: ${{ inputs.os }}-${{ inputs.ip_family }}-${{ matrix.e2e_test_mode }}-${{ inputs.k8s_version }}-${{ inputs.image_tag }}-debuglog.txt
path: test/e2edebugLog.txt
retention-days: 7

- name: Upload e2e report
if: ${{ env.UPLOAD_E2E_REPORT == 'true' }}
uses: actions/upload-artifact@v4.5.0
with:
name: ${{ inputs.os }}-${{ inputs.ip_family }}-${{ matrix.e2e_test_mode }}-${{ inputs.k8s_version }}-e2ereport.json
name: ${{ inputs.os }}-${{ inputs.ip_family }}-${{ matrix.e2e_test_mode }}-${{ inputs.k8s_version }}-${{ inputs.image_tag }}-e2ereport.json
path: e2ereport.json
retention-days: 1

Expand Down Expand Up @@ -293,7 +295,7 @@ jobs:
if: ${{ env.UNINSTALL_E2E_PASS == 'false' && env.UPLOAD_UNINSTALL_E2E_LOG == 'true' }}
uses: actions/upload-artifact@v4.5.0
with:
name: ${{ inputs.os }}-${{ inputs.ip_family }}-${{ matrix.e2e_test_mode }}-${{ inputs.k8s_version }}-uninstall-debugLog.txt
name: ${{ inputs.os }}-${{ inputs.ip_family }}-${{ matrix.e2e_test_mode }}-${{ inputs.k8s_version }}-${{ inputs.image_tag }}-uninstall-debugLog.txt
path: test/e2e-uninstall-debugLog.txt
retention-days: 7

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/lint-golang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,16 +216,16 @@ jobs:
if: ${{ steps.unittest.outcome == 'failure' }}
uses: actions/upload-artifact@v4.5.0
with:
name: coverage.out
path: coverage.out
name: ${{ needs.filter_changes.outputs.ref }}-coverage.out
path: ${{ needs.filter_changes.outputs.ref }}-coverage.out
retention-days: 1

- name: Upload Report Artifact
if: ${{ steps.unittest.outcome == 'failure' }}
uses: actions/upload-artifact@v4.5.0
with:
name: unittestreport.json
path: unittestreport.json
name: ${{ needs.filter_changes.outputs.ref }}-unittestreport.json
path: ${{ needs.filter_changes.outputs.ref }}-unittestreport.json
retention-days: 1

# ============= upload coverage report
Expand All @@ -234,7 +234,7 @@ jobs:
uses: codecov/codecov-action@v4
with:
directory: './'
files: 'coverage.out'
files: '${{ needs.filter_changes.outputs.ref }}-coverage.out'
flags: unittests
name: my-codecov-umbrella
fail_ci_if_error: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/trivy-scan-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ jobs:
- name: Download spiderpool-agent image
uses: actions/download-artifact@v4.1.8
with:
name: image-tar-spiderpool-agent
name: image-tar-spiderpool-agent-${{ inputs.ref }}
path: test/.download

- name: Download spiderpool-controller image
uses: actions/download-artifact@v4.1.8
with:
name: image-tar-spiderpool-controller
name: image-tar-spiderpool-controller-${{ inputs.ref }}
path: test/.download

- name: List downloaded files
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/update-chart-readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ jobs:
- name: Upload artifact digests
uses: actions/upload-artifact@v4.5.0
with:
name: README.md
path: thisProject/charts/spiderpool/README.md
name: ${{github.event.pull_request.head.ref}}-README.md
path: thisProject/charts/spiderpool/${{github.event.pull_request.head.ref}}-README.md

- name: Diff chart/README.md
run: |
Expand All @@ -67,6 +67,6 @@ jobs:
echo -e "\033[31mPlease refer to artifact, and then commit the code.\033[0m"
echo -e "\033[31mAlternatively, copy the contents of the new README.md below into your commit.\033[0m"
echo -e "\033[31m-----------------------------\033[0m"
cat charts/spiderpool/README.md
cat charts/spiderpool/${{github.event.pull_request.head.ref}}-README.md
exit 1
fi

0 comments on commit 28236cd

Please sign in to comment.