Skip to content

Commit

Permalink
docs: add warning note on self-hosted github runners
Browse files Browse the repository at this point in the history
  • Loading branch information
samypr100 committed Aug 6, 2024
1 parent dd20afd commit 4b5fb33
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ To preview any changes to the documentation locally:

1. Install the [Rust toolchain](https://www.rust-lang.org/tools/install).

1. Run `cargo dev generate-all`, to update any auto-generated documentation.
2. Run `cargo dev generate-all`, to update any auto-generated documentation.

1. Run the development server with:
3. Run the development server with:

```shell
# For contributors.
Expand Down
24 changes: 24 additions & 0 deletions docs/guides/integration/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,30 @@ Its effect on performance is dependent on the packages being installed.

If using `uv pip`, use `requirements.txt` instead of `uv.lock` in the cache key.

!!! warning

[post-job-hook]: https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/running-scripts-before-or-after-a-job

When using non-ephemeral self-hosted runners the default cache location can grow over time,
becoming problematic. In such cases its possible to set the caching location relative to the
GitHub Workspace and clean it once the job finishes using a [Post Job Hook][post-job-hook].

```yaml
install_job:
env:
# Configure a relative location for the uv cache
UV_CACHE_DIR: ${{ github.workspace }}/.cache/uv
# ... restore uv cache ...
```

Using a post job hook requires setting the `ACTIONS_RUNNER_HOOK_JOB_STARTED` environment
variable on the self-hosted runner to the path of a cleanup script such as the one shown below.

```sh
#!/usr/bin/env sh
rm -rf $GITHUB_WORKSPACE/*
```

## Using `uv pip`

If using the `uv pip` interface instead of the uv project interface, uv requires a virtual
Expand Down

0 comments on commit 4b5fb33

Please sign in to comment.