{"id":15284385,"url":"https://github.com/hanaasagi/zig-action-cache","last_synced_at":"2025-04-12T23:34:25.557Z","repository":{"id":163576877,"uuid":"638541726","full_name":"Hanaasagi/zig-action-cache","owner":"Hanaasagi","description":"GitHub action cache for zig project","archived":false,"fork":false,"pushed_at":"2024-09-24T07:57:43.000Z","size":1549,"stargazers_count":7,"open_issues_count":9,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T23:34:17.605Z","etag":null,"topics":["ci","github-actions","zig"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/zig-action-cache","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hanaasagi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-09T15:14:13.000Z","updated_at":"2025-02-21T19:31:36.000Z","dependencies_parsed_at":"2024-02-02T14:10:34.729Z","dependency_job_id":"87fb2322-6e41-4ebb-935e-246fbc8de97f","html_url":"https://github.com/Hanaasagi/zig-action-cache","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":"actions/typescript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hanaasagi%2Fzig-action-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hanaasagi%2Fzig-action-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hanaasagi%2Fzig-action-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hanaasagi%2Fzig-action-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hanaasagi","download_url":"https://codeload.github.com/Hanaasagi/zig-action-cache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647259,"owners_count":21139081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci","github-actions","zig"],"created_at":"2024-09-30T14:54:56.049Z","updated_at":"2025-04-12T23:34:25.523Z","avatar_url":"https://github.com/Hanaasagi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Action Cache For Zig\n\nAn out-of-the-box GitHub Action that automatically caches dependencies and compiled artifacts for a Zig project.\n\n## How it works \n\nFirstly, it calculates a key based on the following states:\n\n- The version of `zig` and the output information of `zig env`.\n- Environment variables during compilation, which can be configured through the `env-vars` parameter in YAML.\n- The file hashes of `build.zig` and `deps.zig`.\n- Automatic detection of whether a package manager is used and file hash calculation for `gyro.zzz` or `zig.mod`.\n- User-configured keys, as shown in the configuration file below.\n\nThen it checks the history to see if there is a build workflow with the same key. If a match is found, it will restore the cache from the previous build.\n\nWhat directories will it cache?\n\n- `global_cache_dir` in `zig env`\n- `zig-cache`\n- If you're using a package manager and there is a lock file, then directories such as `.gyro/` or `.zigmod/` will be cached.\n\n\n## Example\n\n```YAML\nname: CI\n\non:\n  push:\n    branches: [\"master\"]\n  pull_request:\n    branches: [\"master\"]\n  workflow_dispatch:\n\njobs:\n  test:\n    name: Tests on Linux\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n      - uses: goto-bus-stop/setup-zig@v2\n        with:\n          version: 0.10.1\n      - uses: Hanaasagi/zig-action-cache@master  # Or Hanaasagi/zig-action-cache@v1\n        with:\n          # description: 'The prefix cache key, this can be changed to start a new cache manually.'\n          # required: false\n          # default: 'zig-cache-step-0'\n          prefix-key: \"\"\n\n          # description: 'A cache key that is used instead of the automatic `job`-based key, and is stable over multiple jobs.'\n          # required: false\n          # default: \"\"\n          shared-key: \"\"\n\n          # description: 'An additional cache key that is added alongside the automatic `job`-based cache key and can be used to further differentiate jobs.'\n          # required: false\n          # default: \"\"\n          key: \"\"\n\n          # description: 'Additional environment variables to include in the cache key, separated by spaces.'\n          # required: false\n          # default: \"\"\n          env-vars: \"\"\n\n          # description: 'Additional non workspace directories to be cached, separated by newlines.'\n          # required: false\n          # default: \"\"\n          cache-directories: \"\"\n\n          # description: 'Cache even if the build fails. Defaults to false.'\n          # required: false\n          # default: 'false'\n          cache-on-failure: true\n\n      - name: Build\n        run: zig build\n      - name: Run Tests\n        run: zig build test\n```\n\n\u003chr\u003e\n\n*Please feel free to report bugs or open pull requests.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanaasagi%2Fzig-action-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhanaasagi%2Fzig-action-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanaasagi%2Fzig-action-cache/lists"}