About workflow artifacts
An artifact is a file or collection of files produced during a workflow run. Artifacts allow you to persist data after a job has completed, and share that data with another job in the same workflow. For example, you can use artifacts to save your build and test output after a workflow run has ended.
GitHub provides two actions that you can use to upload and download build artifacts, upload-artifact
and download-artifact
on GitHub Enterprise Server.
Common artifacts include:
- Log files and core dumps
- Test results, failures, and screenshots
- Binary or compressed files
- Stress test performance output and code coverage results
比较构件和依赖项缓存
构件与缓存类似,因为它们能够在 GitHub 上存储文件,但每项功能都提供不同的用例,不能互换使用。
- 当想要重复使用在作业或工作流运行之间不频繁更改的文件时(例如从程序包管理系统构建依赖项),请使用缓存。
- 如果要保存作业生成的文件,以在工作流运行结束后查看(例如生成的二进制文件或生成日志),请使用项目。
For more information on dependency caching, see Dependency caching reference.
已删除的工作流运行中的工件
删除某个工作流运行时,也会从存储中删除与该运行关联的所有工件。 可以使用 GitHub Actions UI、REST API 或使用 GitHub CLI 删除工作流运行,请参阅“删除工作流程运行”、删除工作流运行或 gh run delete。