Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(integration): show pinned version example on GH Actions #6234

Merged
merged 3 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 105 additions & 28 deletions docs/guides/integration/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,124 @@

## Installation

uv installation differs depending on the platform.
uv installation differs depending on the platform:

### Unix
=== "Unix"

```yaml title="example.yml"
name: Example on Unix
```yaml title="example.yml"
name: Example on Unix

jobs:
uv-example-linux:
name: python-linux
runs-on: ubuntu-latest
jobs:
uv-example-linux:
name: python-linux
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
steps:
- uses: actions/checkout@v4

- name: Set up uv
# Install uv using the standalone installer
run: curl -LsSf https://astral.sh/uv/install.sh | sh
```
- name: Set up uv
# Install latest uv version using the installer
run: curl -LsSf https://astral.sh/uv/install.sh | sh
```

### Windows
=== "macOS"

```yaml title="example.yml"
name: Example on Windows
```yaml title="example.yml"
name: Example on macOS

jobs:
uv-example-windows:
name: python-windows
runs-on: windows-latest
jobs:
uv-example-macos:
name: python-macos
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
steps:
- uses: actions/checkout@v4

- name: Set up uv
# Install uv using the standalone installer
run: irm https://astral.sh/uv/install.ps1 | iex
shell: powershell
```
- name: Set up uv
# Install latest uv version using the installer
run: curl -LsSf https://astral.sh/uv/install.sh | sh
```

=== "Windows"

```yaml title="example.yml"
name: Example on Windows

jobs:
uv-example-windows:
name: python-windows
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Set up uv
# Install latest uv version using the installer
run: irm https://astral.sh/uv/install.ps1 | iex
shell: powershell
```

It is considered best practice to pin to a specific uv version, e.g., with:

=== "Unix"

```yaml title="example.yml"
name: Example on Unix

jobs:
uv-example-linux:
name: python-linux
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up uv
# Install a specific uv version using the installer
run: curl -LsSf https://astral.sh/uv/0.2.37/install.sh | sh
```

=== "macOS"

```yaml title="example.yml"
name: Example on macOS

jobs:
uv-example-macos:
name: python-macos
runs-on: macos-latest

steps:
- uses: actions/checkout@v4

- name: Set up uv
# Install a specific uv version using the installer
run: curl -LsSf https://astral.sh/uv/0.2.37/install.sh | sh
```

=== "Windows"

```yaml title="example.yml"
name: Example on Windows

jobs:
uv-example-windows:
name: python-windows
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Set up uv
# Install a specific uv version using the installer
run: irm https://astral.sh/uv/0.2.37/install.ps1 | iex
shell: powershell
```

### Using a matrix

If you need to support multiple platforms, you can use a matrix:

```yaml title="example.yml"
name: Example

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ version_files = [
"crates/uv/Cargo.toml",
"crates/uv-version/Cargo.toml",
"docs/guides/integration/pre-commit.md",
"docs/guides/integration/github.md",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure of the heuristic used by rooster to find references to uv versions, so not sure if this will actually work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this will work, it replaces the last version number with the new version number — that's all. Thank you!

]

[tool.uv]
Expand Down
Loading