Skip to content
Closed
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
13 changes: 12 additions & 1 deletion .github/actions/setup-rust/action.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Setup Rust
description: Installs rust in a bare metal fashion
description: Install Rust toolchain (from rust-toolchain.toml), protoc, and cache cargo state.
inputs:
caller-workflow-name:
description: 'Name of workflow used for creating a cache key in ASCII format.'
Expand All @@ -18,6 +18,17 @@ runs:
run: "echo Cache key: ${{ steps.cache-key-generator.outputs.cache-key }}"
shell: bash

# Stock GitHub-hosted runners ship rustup but no specific toolchain. Install the
# toolchain pinned in rust-toolchain.toml (channel = "1.84" at the time of writing).
# We pass the channel explicitly rather than reading the toml because dtolnay's
# action overrides toml-pinning when `toolchain:` is set, and we want predictable
# CI behavior whether a user runs the workflow on stock runners or self-hosted ones
# that already have rust installed.
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.84
with:
components: rustfmt, clippy
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hardcoded toolchain version duplicates rust-toolchain.toml source of truth

Low Severity

The action description on line 2 says "Install Rust toolchain (from rust-toolchain.toml)" but the implementation uses dtolnay/rust-toolchain@1.84 which hardcodes the version and never reads rust-toolchain.toml. This creates a dual source of truth — rust-toolchain.toml declares channel = "1.84" and components ["rustfmt", "rustc-dev", "clippy", "cargo"], but the action independently pins @1.84 with only rustfmt, clippy. When someone bumps the channel in rust-toolchain.toml, CI will silently keep using the old version, causing local/CI divergence that's hard to diagnose.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7f8e6ea. Configure here.


- name: Install Protobuf
run: |
export PROTOC_VERSION=23.4 && \
Expand Down
29 changes: 4 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,21 @@ on:

jobs:
build:
runs-on: ubuntu-22.04-16c-64g-public
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
lfs: true

- name: Sanity Check
run: |
cat /proc/cpuinfo

- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
caller-workflow-name: test
caller-workflow-name: build

- name: Clippy check
run: cargo clippy --all-features --all-targets --tests -- -D warnings

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# see https://docs.docker.com/build/ci/github-actions/cache/#cache-backend-api
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PWD }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: jitolabs/jito-shredstream-proxy:${{github.sha}}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/arm64,linux/x86_64
- name: Release build
run: cargo build --release --locked --bin jito-shredstream-proxy
38 changes: 8 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,36 @@ name: release

on:
push:
# branches:
# - master
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-22.04-16c-64g-public
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
lfs: true

- name: Sanity Check
run: |
cat /proc/cpuinfo

- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
caller-workflow-name: test
caller-workflow-name: release

- name: Clippy check
run: cargo clippy --all-features --all-targets --tests -- -D warnings

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# see https://docs.docker.com/build/ci/github-actions/cache/#cache-backend-api
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PWD }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: jitolabs/jito-shredstream-proxy:${{github.ref_name}}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/arm64,linux/x86_64
- name: Release build
run: cargo build --release --locked --bin jito-shredstream-proxy

- name: Copy artifact from container
- name: Stage artifact
run: |
docker run --rm --platform linux/x86_64 --entrypoint cat jitolabs/jito-shredstream-proxy:${{github.ref_name}} /app/jito-shredstream-proxy > ./jito-shredstream-proxy-x86_64-unknown-linux-gnu
ls -lh .
cp target/release/jito-shredstream-proxy \
./jito-shredstream-proxy-x86_64-unknown-linux-gnu
file ./jito-shredstream-proxy-x86_64-unknown-linux-gnu
ls -lh ./jito-shredstream-proxy-x86_64-unknown-linux-gnu

- name: Release
uses: softprops/action-gh-release@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
test:
runs-on: ubuntu-22.04-16c-64g-public
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
Loading