Skip to content
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
43 changes: 2 additions & 41 deletions .github/actions/prepare-release-benchmarks/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,49 +20,10 @@ runs:
exit 1
fi

- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
- name: Set up declared tools without caches
uses: ./.github/actions/setup-tools # zizmor: ignore[self-repository] actionlint 1.7.12 does not accept $/...
with:
cache: false
cache-bin: false

- name: Set up just
uses: ./.github/actions/setup-just # zizmor: ignore[self-repository] actionlint 1.7.12 does not accept $/...
with:
cache: false

- name: Resolve tool versions
id: tool_versions
shell: bash
run: |
set -euo pipefail

version="$(just --evaluate cargo_nextest_version)"
uv_version="$(just --evaluate uv_version)"
if [[ -z "$version" || -z "$uv_version" ]]; then
echo "::error::Could not resolve pinned tool versions from justfile"
exit 1
fi

echo "version=$version" >> "$GITHUB_OUTPUT"
echo "uv_version=$uv_version" >> "$GITHUB_OUTPUT"

- name: Install cargo-nextest
shell: bash
env:
CARGO_NEXTEST_VERSION: ${{ steps.tool_versions.outputs.version }}
run: cargo install --locked cargo-nextest --version "$CARGO_NEXTEST_VERSION"

- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version-file: ".python-version"

- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
version: ${{ steps.tool_versions.outputs.uv_version }}
enable-cache: false

- name: Validate benchmark inputs
shell: bash
Expand Down
65 changes: 0 additions & 65 deletions .github/actions/setup-just/action.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/actions/setup-tools/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Set up declared tools
description: Install the locked shared package, synchronize declared tools, and export verified paths.

inputs:
cache:
description: Restore and save managed tool installations; release jobs must disable this.
required: false
default: "true"

runs:
using: composite
steps:
- name: Install declared uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
version-file: pyproject.toml
enable-cache: ${{ inputs.cache }}
cache-python: false

- name: Cache declared Rust and Cargo tools
if: inputs.cache == 'true'
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ runner.temp }}/rrt
key: rrt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('rust-toolchain.toml', 'pyproject.toml', 'uv.lock', '.python-version') }}
restore-keys: rrt-${{ runner.os }}-${{ runner.arch }}-

- name: Set up declared tools and development environment
shell: bash
env:
RESEARCH_REPO_TOOLS_HOME: ${{ runner.temp }}/rrt
run: uv run --locked --managed-python --only-group tooling research-repo-tools setup

- name: Export verified managed paths
shell: bash
env:
RESEARCH_REPO_TOOLS_HOME: ${{ runner.temp }}/rrt
run: uv run --locked --no-sync --no-python-downloads research-repo-tools toolchain export
39 changes: 10 additions & 29 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ on:
- "Cargo.lock"
- "justfile"
- "rust-toolchain.toml"
- ".github/actions/setup-just/action.yml"
- "pyproject.toml"
- "uv.lock"
- ".python-version"
- ".github/actions/setup-tools/action.yml"
- ".github/workflows/benchmarks.yml"
pull_request:
branches:
Expand All @@ -36,7 +39,10 @@ on:
- "Cargo.lock"
- "justfile"
- "rust-toolchain.toml"
- ".github/actions/setup-just/action.yml"
- "pyproject.toml"
- "uv.lock"
- ".python-version"
- ".github/actions/setup-tools/action.yml"
- ".github/workflows/benchmarks.yml"
workflow_dispatch:

Expand Down Expand Up @@ -65,33 +71,8 @@ jobs:
with:
persist-credentials: false

- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
with:
cache: true
cache-bin: false

- name: Set up just
uses: ./.github/actions/setup-just # zizmor: ignore[self-repository] actionlint 1.7.12 does not accept $/...

- name: Resolve cargo-nextest version
id: cargo_nextest_version
shell: bash
run: |
set -euo pipefail

version="$(just --evaluate cargo_nextest_version)"
if [[ -z "$version" ]]; then
echo "::error::Could not resolve cargo_nextest_version from justfile"
exit 1
fi

echo "version=$version" >> "$GITHUB_OUTPUT"

- name: Install cargo-nextest
uses: taiki-e/cache-cargo-install-action@9ee83daaa7b96a6fab930949ecf1122bba04a389 # v3.0.8
with:
tool: cargo-nextest@${{ steps.cargo_nextest_version.outputs.version }}
- name: Set up declared tools
uses: ./.github/actions/setup-tools # zizmor: ignore[self-repository] actionlint 1.7.12 does not accept $/...

- name: Validate benchmark inputs
run: just test-bench-inputs
Expand Down
126 changes: 2 additions & 124 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ jobs:
- ubuntu-latest
- macos-latest
- windows-latest
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc

steps:
- name: Disable Git autocrlf on Windows
Expand All @@ -55,123 +48,8 @@ jobs:
with:
persist-credentials: false

- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
with:
target: ${{ matrix.target }}
cache: true
cache-bin: false
# toolchain, components, etc. are specified in rust-toolchain.toml

- name: Set up just
uses: ./.github/actions/setup-just # zizmor: ignore[self-repository] actionlint 1.7.12 does not accept $/...

- name: Export tool versions
id: tool_versions
shell: bash
run: |
set -euo pipefail

resolve_version() {
local name="$1"
local value

if ! value="$(just --evaluate "$name")"; then
echo "::error::Failed to resolve $name from justfile" >&2
return 1
fi
if [[ -z "$value" ]]; then
echo "::error::Resolved empty $name from justfile" >&2
return 1
fi

printf '%s\n' "$value"
}

cargo_machete_version="$(resolve_version cargo_machete_version)"
cargo_nextest_version="$(resolve_version cargo_nextest_version)"
dprint_version="$(resolve_version dprint_version)"
git_cliff_version="$(resolve_version git_cliff_version)"
rumdl_version="$(resolve_version rumdl_version)"
taplo_version="$(resolve_version taplo_version)"
typos_version="$(resolve_version typos_version)"
uv_version="$(resolve_version uv_version)"
zizmor_version="$(resolve_version zizmor_version)"

{
echo "CARGO_MACHETE_VERSION=$cargo_machete_version"
echo "CARGO_NEXTEST_VERSION=$cargo_nextest_version"
echo "DPRINT_VERSION=$dprint_version"
echo "GIT_CLIFF_VERSION=$git_cliff_version"
echo "RUMDL_VERSION=$rumdl_version"
echo "TAPLO_VERSION=$taplo_version"
echo "TYPOS_VERSION=$typos_version"
echo "UV_VERSION=$uv_version"
echo "ZIZMOR_VERSION=$zizmor_version"
} >> "$GITHUB_OUTPUT"

- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version-file: ".python-version"

- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
version: ${{ steps.tool_versions.outputs.UV_VERSION }}
enable-cache: true

- name: Sync Python tooling
run: uv sync --locked --group dev

- name: Install dprint
uses: taiki-e/cache-cargo-install-action@9ee83daaa7b96a6fab930949ecf1122bba04a389 # v3.0.8
with:
tool: dprint@${{ steps.tool_versions.outputs.DPRINT_VERSION }}

- name: Install rumdl
uses: taiki-e/cache-cargo-install-action@9ee83daaa7b96a6fab930949ecf1122bba04a389 # v3.0.8
with:
tool: rumdl@${{ steps.tool_versions.outputs.RUMDL_VERSION }}

- name: Install taplo
id: install-taplo
continue-on-error: ${{ matrix.os == 'windows-latest' }}
uses: taiki-e/cache-cargo-install-action@9ee83daaa7b96a6fab930949ecf1122bba04a389 # v3.0.8
with:
tool: taplo-cli@${{ steps.tool_versions.outputs.TAPLO_VERSION }}

- name: Install taplo on Windows after cached install failure
if: matrix.os == 'windows-latest' && steps.install-taplo.outcome == 'failure'
shell: pwsh
run: cargo install --locked taplo-cli --version $env:TAPLO_VERSION
env:
TAPLO_VERSION: ${{ steps.tool_versions.outputs.TAPLO_VERSION }}

- name: Install typos
uses: taiki-e/cache-cargo-install-action@9ee83daaa7b96a6fab930949ecf1122bba04a389 # v3.0.8
with:
tool: typos-cli@${{ steps.tool_versions.outputs.TYPOS_VERSION }}

- name: Install zizmor
uses: taiki-e/cache-cargo-install-action@9ee83daaa7b96a6fab930949ecf1122bba04a389 # v3.0.8
with:
tool: zizmor@${{ steps.tool_versions.outputs.ZIZMOR_VERSION }}

- name: Install cargo-machete
uses: taiki-e/cache-cargo-install-action@9ee83daaa7b96a6fab930949ecf1122bba04a389 # v3.0.8
with:
tool: cargo-machete@${{ steps.tool_versions.outputs.CARGO_MACHETE_VERSION }}

- name: Install cargo-nextest
uses: taiki-e/cache-cargo-install-action@9ee83daaa7b96a6fab930949ecf1122bba04a389 # v3.0.8
with:
tool: cargo-nextest@${{ steps.tool_versions.outputs.CARGO_NEXTEST_VERSION }}

- name: Install git-cliff
uses: taiki-e/cache-cargo-install-action@9ee83daaa7b96a6fab930949ecf1122bba04a389 # v3.0.8
with:
tool: git-cliff@${{ steps.tool_versions.outputs.GIT_CLIFF_VERSION }}
- name: Set up declared tools
uses: ./.github/actions/setup-tools # zizmor: ignore[self-repository] actionlint 1.7.12 does not accept $/...

- name: Run CI checks
run: just ci
Loading
Loading