Commit 5701753a authored by Anant Sharma's avatar Anant Sharma Committed by GitHub
Browse files

ci: add rust build and pre-merge checks (#91)

parent db48e835
......@@ -88,3 +88,38 @@ jobs:
# - run: ./icp/protos/gen_python.sh
# - run: pytest -p no:warnings --verbose worker/python/tests
# timeout-minutes: 2
pre-merge-rust:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up system dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y protobuf-compiler
- name: Cache Cargo Registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache Cargo Target Directory
uses: actions/cache@v3
with:
path: runtime/rust/target
key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.lock') }}
- name: Set up Rust Toolchain Components
run: rustup component add rustfmt clippy
- name: Run Cargo Check
working-directory: runtime/rust
run: cargo check --locked
- name: Verify Code Formatting
working-directory: runtime/rust
run: cargo fmt -- --check
- name: Run Clippy Checks
working-directory: runtime/rust
run: cargo clippy --no-deps --all-targets -- -D warnings
- name: Run Unit Tests
working-directory: runtime/rust
run: cargo test --locked --all-targets
\ No newline at end of file
......@@ -25,7 +25,9 @@ USER root
# TODO: separate dev from runtime dependendcies
RUN apt-get update; apt-get install -y gdb
RUN apt-get update; apt-get install -y gdb protobuf-compiler
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
# Install OpenAI-compatible frontend and its dependencies from triton server
# repository. These are used to have a consistent interface, schema, and FastAPI
......@@ -149,6 +151,7 @@ WORKDIR /workspace
#TODO Exclude container directory
COPY . /workspace
RUN cd runtime/rust && cargo build --release --locked && cargo doc --no-deps
RUN /workspace/icp/protos/gen_python.sh
# Sets pythonpath for python modules
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment