Skip to content

ci: Consider replacing delete-artifact with cache Action #1269

Open
@radeksimko

Description

@radeksimko

Context

As part of adopting CRT, we also ended up adopting GitHub Action for deleting artifact https://github.com/marketplace/actions/delete-artifact

Ideally CRT would allow us to filter which artifacts we want to upload, which is a planned feature.

That said, in practice we may not need to make provider schemas an actual artifact. We may be able just treat it as a cache entry and use the actions/cache/save and actions/cache/restore instead.

Terraform faces similar problem and uses the actions/cache Action:
https://github.com/hashicorp/terraform/blob/main/.github/workflows/build.yml#L155-L254

Proposal

Investigate replacing upload-artifact, download-artifact and delete-artifact with actions/cache:

- uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # https://github.com/actions/upload-artifact/releases/tag/v3.1.1
with:
name: provider-schema-data
path: ./internal/schemas/data
retention-days: 1

- name: Download provider schemas
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # https://github.com/actions/download-artifact/releases/tag/v3.0.2
with:
name: provider-schema-data
path: ./internal/schemas/data

delete-provider-schemas:
needs: build
runs-on: ubuntu-latest
steps:
- uses: geekyeggo/delete-artifact@54ab544f12cdb7b71613a16a2b5a37a9ade990af # https://github.com/GeekyEggo/delete-artifact/releases/tag/v2.0.0
with:
name: provider-schema-data

Metadata

Metadata

Assignees

No one assigned

    Labels

    ciContinuous integration/delivery relatedenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions