Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
5701753a
Commit
5701753a
authored
Feb 04, 2025
by
Anant Sharma
Committed by
GitHub
Feb 04, 2025
Browse files
ci: add rust build and pre-merge checks (#91)
parent
db48e835
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
1 deletion
+39
-1
.github/workflows/pre-merge.yml
.github/workflows/pre-merge.yml
+35
-0
container/Dockerfile
container/Dockerfile
+4
-1
No files found.
.github/workflows/pre-merge.yml
View file @
5701753a
...
...
@@ -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
container/Dockerfile
View file @
5701753a
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment