Skip to content

Commit

Permalink
ci: migrate upload steps
Browse files Browse the repository at this point in the history
This commit migrates upload-artifact github action from v3 to v4

With version 4 artifacts are immutable so consequent uploads with
the same artifact name fail. The artifact's names changes to be unique.
Also, to combine all artifacts merge-upload job is added.
This job downloads, merges, and uploads the merged artifact.
All temporary artifacts are deleted.

Signed-off-by: Birol Bilgin <birol@cilium.io>
  • Loading branch information
brlbil authored and dylandreimerink committed Mar 12, 2024
1 parent f035118 commit 1be2c7b
Show file tree
Hide file tree
Showing 7 changed files with 175 additions and 28 deletions.
29 changes: 25 additions & 4 deletions .github/workflows/conformance-aws-cni.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -279,24 +279,45 @@ jobs:
if: ${{ !success() }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-sysdumps
name: cilium-sysdumps-${{ matrix.version }}
path: cilium-sysdump-*.zip
retention-days: 5

- name: Upload JUnits [junit]
if: ${{ always() }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-junits
name: cilium-junits-${{ matrix.version }}
path: cilium-junits/*.xml
retention-days: 2

- name: Publish Test Results As GitHub Summary
if: ${{ always() }}
uses: aanm/junit2md@332ebf0fddd34e91b03a832cfafaa826306558f9 # v0.0.3
with:
junit-directory: "cilium-junits"

merge-upload:
if: ${{ always() }}
name: Merge and Upload Artifacts
runs-on: ubuntu-latest
needs: installation-and-connectivity
steps:
- name: Merge Sysdumps
if: ${{ needs.installation-and-connectivity.result == 'failure' }}
uses: actions/upload-artifact/merge@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-sysdumps
pattern: cilium-sysdumps-*
retention-days: 5
delete-merged: true
continue-on-error: true
- name: Merge JUnits
uses: actions/upload-artifact/merge@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-junits
pattern: cilium-junits-*
retention-days: 5
delete-merged: true

commit-status-final:
if: ${{ always() }}
name: Commit Status Final
Expand Down
29 changes: 25 additions & 4 deletions .github/workflows/conformance-clustermesh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -428,24 +428,45 @@ jobs:
if: ${{ !success() }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-sysdumps
name: cilium-sysdumps-${{ matrix.name }}
path: cilium-sysdump-*.zip
retention-days: 5

- name: Upload JUnits [junit]
if: ${{ always() }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-junits
name: cilium-junits-${{ matrix.name }}
path: cilium-junits/*.xml
retention-days: 2

- name: Publish Test Results As GitHub Summary
if: ${{ always() }}
uses: aanm/junit2md@332ebf0fddd34e91b03a832cfafaa826306558f9 # v0.0.3
with:
junit-directory: "cilium-junits"

merge-upload:
if: ${{ always() }}
name: Merge and Upload Artifacts
runs-on: ubuntu-latest
needs: installation-and-connectivity
steps:
- name: Merge Sysdumps
if: ${{ needs.installation-and-connectivity.result == 'failure' }}
uses: actions/upload-artifact/merge@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-sysdumps
pattern: cilium-sysdumps-*
retention-days: 5
delete-merged: true
continue-on-error: true
- name: Merge JUnits
uses: actions/upload-artifact/merge@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-junits
pattern: cilium-junits-*
retention-days: 5
delete-merged: true

commit-status-final:
if: ${{ always() }}
name: Commit Status Final
Expand Down
29 changes: 25 additions & 4 deletions .github/workflows/conformance-eks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -304,24 +304,45 @@ jobs:
if: ${{ !success() }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-sysdumps
name: cilium-sysdumps-${{ matrix.version }}
path: cilium-sysdump-*.zip
retention-days: 5

- name: Upload JUnits [junit]
if: ${{ always() }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-junits
name: cilium-junits-${{ matrix.version }}
path: cilium-junits/*.xml
retention-days: 2

- name: Publish Test Results As GitHub Summary
if: ${{ always() }}
uses: aanm/junit2md@332ebf0fddd34e91b03a832cfafaa826306558f9 # v0.0.3
with:
junit-directory: "cilium-junits"

merge-upload:
if: ${{ always() }}
name: Merge and Upload Artifacts
runs-on: ubuntu-latest
needs: installation-and-connectivity
steps:
- name: Merge Sysdumps
if: ${{ needs.installation-and-connectivity.result == 'failure' }}
uses: actions/upload-artifact/merge@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-sysdumps
pattern: cilium-sysdumps-*
retention-days: 5
delete-merged: true
continue-on-error: true
- name: Merge JUnits
uses: actions/upload-artifact/merge@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-junits
pattern: cilium-junits-*
retention-days: 5
delete-merged: true

commit-status-final:
if: ${{ always() }}
name: Commit Status Final
Expand Down
29 changes: 25 additions & 4 deletions .github/workflows/conformance-externalworkloads.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -336,24 +336,45 @@ jobs:
if: ${{ !success() }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-sysdumps
name: cilium-sysdumps-${{ matrix.vmIndex }}
path: cilium-sysdump-*.zip
retention-days: 5

- name: Upload JUnits [junit]
if: ${{ always() }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-junits
name: cilium-junits-${{ matrix.vmIndex }}
path: cilium-junits/*.xml
retention-days: 2

- name: Publish Test Results As GitHub Summary
if: ${{ always() }}
uses: aanm/junit2md@332ebf0fddd34e91b03a832cfafaa826306558f9 # v0.0.3
with:
junit-directory: "cilium-junits"

merge-upload:
if: ${{ always() }}
name: Merge and Upload Artifacts
runs-on: ubuntu-latest
needs: installation-and-connectivity
steps:
- name: Merge Sysdumps
if: ${{ needs.installation-and-connectivity.result == 'failure' }}
uses: actions/upload-artifact/merge@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-sysdumps
pattern: cilium-sysdumps-*
retention-days: 5
delete-merged: true
continue-on-error: true
- name: Merge JUnits
uses: actions/upload-artifact/merge@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-junits
pattern: cilium-junits-*
retention-days: 5
delete-merged: true

commit-status-final:
if: ${{ always() }}
name: Commit Status Final
Expand Down
29 changes: 25 additions & 4 deletions .github/workflows/conformance-gke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -295,24 +295,45 @@ jobs:
if: ${{ !success() }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-sysdumps
name: cilium-sysdumps-${{ matrix.config.index }}-${{ matrix.k8s.vmIndex }}
path: cilium-sysdump-*.zip
retention-days: 5

- name: Upload JUnits [junit]
if: ${{ always() }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-junits
name: cilium-junits-${{ matrix.config.index }}-${{ matrix.k8s.vmIndex }}
path: cilium-junits/*.xml
retention-days: 2

- name: Publish Test Results As GitHub Summary
if: ${{ always() }}
uses: aanm/junit2md@332ebf0fddd34e91b03a832cfafaa826306558f9 # v0.0.3
with:
junit-directory: "cilium-junits"

merge-upload:
if: ${{ always() }}
name: Merge and Upload Artifacts
runs-on: ubuntu-latest
needs: installation-and-connectivity
steps:
- name: Merge Sysdumps
if: ${{ needs.installation-and-connectivity.result == 'failure' }}
uses: actions/upload-artifact/merge@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-sysdumps
pattern: cilium-sysdumps-*
retention-days: 5
delete-merged: true
continue-on-error: true
- name: Merge JUnits
uses: actions/upload-artifact/merge@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-junits
pattern: cilium-junits-*
retention-days: 5
delete-merged: true

commit-status-final:
if: ${{ always() }}
name: Commit Status Final
Expand Down
29 changes: 25 additions & 4 deletions .github/workflows/conformance-ipsec-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -325,24 +325,45 @@ jobs:
if: ${{ !success() }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-sysdumps
name: cilium-sysdumps-${{ matrix.name }}
path: cilium-sysdump-*.zip
retention-days: 5

- name: Upload JUnits [junit]
if: ${{ always() }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-junits
name: cilium-junits-${{ matrix.name }}
path: cilium-junits/*.xml
retention-days: 2

- name: Publish Test Results As GitHub Summary
if: ${{ always() }}
uses: aanm/junit2md@332ebf0fddd34e91b03a832cfafaa826306558f9 # v0.0.3
with:
junit-directory: "cilium-junits"

merge-upload:
if: ${{ always() }}
name: Merge and Upload Artifacts
runs-on: ubuntu-latest
needs: setup-and-test
steps:
- name: Merge Sysdumps
if: ${{ needs.setup-and-test.result == 'failure' }}
uses: actions/upload-artifact/merge@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-sysdumps
pattern: cilium-sysdumps-*
retention-days: 5
delete-merged: true
continue-on-error: true
- name: Merge JUnits
uses: actions/upload-artifact/merge@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-junits
pattern: cilium-junits-*
retention-days: 5
delete-merged: true

commit-status-final:
if: ${{ always() }}
needs: setup-and-test
Expand Down
29 changes: 25 additions & 4 deletions .github/workflows/tests-ipsec-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -391,24 +391,45 @@ jobs:
if: ${{ steps.vars.outputs.downgrade_version != '' && !success() }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-sysdumps
name: cilium-sysdumps-${{ matrix.config }}-${{ matrix.mode }}
path: cilium-sysdump-*.zip
retention-days: 5

- name: Upload JUnits [junit]
if: ${{ steps.vars.outputs.downgrade_version != '' && always() }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-junits
name: cilium-junits-${{ matrix.config }}-${{ matrix.mode }}
path: cilium-junits/*.xml
retention-days: 2

- name: Publish Test Results As GitHub Summary
if: ${{ steps.vars.outputs.downgrade_version != '' && always() }}
uses: aanm/junit2md@332ebf0fddd34e91b03a832cfafaa826306558f9 # v0.0.3
with:
junit-directory: "cilium-junits"

merge-upload:
if: ${{ always() }}
name: Merge and Upload Artifacts
runs-on: ubuntu-latest
needs: setup-and-test
steps:
- name: Merge Sysdumps
if: ${{ needs.setup-and-test.result == 'failure' }}
uses: actions/upload-artifact/merge@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-sysdumps
pattern: cilium-sysdumps-*
retention-days: 5
delete-merged: true
continue-on-error: true
- name: Merge JUnits
uses: actions/upload-artifact/merge@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: cilium-junits
pattern: cilium-junits-*
retention-days: 5
delete-merged: true

commit-status-final:
if: ${{ always() }}
name: Commit Status Final
Expand Down

0 comments on commit 1be2c7b

Please sign in to comment.