Skip to content

ci: Add build-and-test workflow #1

ci: Add build-and-test workflow

ci: Add build-and-test workflow #1

Workflow file for this run

name: build-and-test
on:
pull_request:
jobs:
run-command:
runs-on: buildjet-8vcpu-ubuntu-2004
steps:
- name: Log workflow inputs
run: echo "${{ toJson(github.event.inputs) }}"
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install rust
shell: bash
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
CARGO_BIN="$HOME/.cargo/bin"
echo 'export PATH="$CARGO_BIN:$PATH"' >> $HOME/.bashrc
echo "$CARGO_BIN" >> $GITHUB_PATH
- name: Install uv
shell: bash
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
UV_BIN="$HOME/.local/bin"
echo 'export PATH="$UV_BIN:$PATH"' >> $HOME/.bashrc
echo "$UV_BIN" >> $GITHUB_PATH
- name: Install (and pin) python version
shell: bash
run: |
uv python install 3.12
uv python pin 3.12
- name: Setup uv environment
run: |
uv v
source .venv/bin/activate
uv pip install ray[default] maturin
- name: Build project
run: |
source .venv/bin/activate
maturin develop --uv
- name: Run tests
run: |
source .venv/bin/activate
cargo test