-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: setup ci tests and checks ( PROOF-622 ) (#1)
# Rationale for this change This PR adds the initial CI workflows necessary to ensure code quality. # What changes are included in this PR? * Add PR template. * Add GitHub actions workflow to test, check, and lint the code. # Are these changes tested? Yes.
- Loading branch information
Showing
5 changed files
with
85 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Rationale for this change | ||
|
||
<!-- | ||
Why are you proposing this change? If this is already explained clearly in the linked Jira ticket then this section is not needed. | ||
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. | ||
--> | ||
|
||
# What changes are included in this PR? | ||
|
||
<!-- | ||
There is no need to duplicate the description in the ticket here but it is sometimes worth providing a summary of the individual changes in this PR. | ||
--> | ||
|
||
# Are these changes tested? | ||
|
||
<!-- | ||
We typically require tests for all PRs in order to: | ||
1. Prevent the code from being accidentally broken by subsequent changes | ||
2. Serve as another way to document the expected behavior of the code | ||
If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Test-Check-Lint | ||
|
||
on: | ||
workflow_call: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
format-code: | ||
name: Check Code | ||
runs-on: self-hosted | ||
steps: | ||
- name: Checkout Code Format | ||
uses: actions/checkout@v3 | ||
- run: docker run --rm -v "$PWD":/src:ro -w /src --privileged spaceandtimelabs/blitzar:12.2.0-cuda-1.71.1-rust-0 /bin/bash -c "cp -av /src/ /src_tmp/; cd /src_tmp; /root/.cargo/bin/cargo fmt --all -- --check" | ||
|
||
clippy-code: | ||
name: Clippy Code | ||
runs-on: self-hosted | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
- run: docker run --rm -v "$PWD":/src:ro -w /src --privileged spaceandtimelabs/blitzar:12.2.0-cuda-1.71.1-rust-0 /bin/bash -c "cp -av /src/ /src_tmp/; cd /src_tmp; /root/.cargo/bin/rustup component add clippy; /root/.cargo/bin/cargo clippy --all-targets --all-features -- -D warnings" | ||
|
||
test-cpu: | ||
name: Test the CPU backend | ||
runs-on: self-hosted | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
- run: docker run --rm -v "$PWD":/src:ro -w /src --privileged spaceandtimelabs/blitzar:12.2.0-cuda-1.71.1-rust-0 /bin/bash -c "cp -av /src/ /src_tmp/; cd /src_tmp; /root/.cargo/bin/cargo test --features cpu" | ||
|
||
test-gpu: | ||
name: Test the GPU backend | ||
runs-on: self-hosted | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
- run: docker run --rm -v "$PWD":/src:ro -w /src --gpus all --privileged spaceandtimelabs/blitzar:12.2.0-cuda-1.71.1-rust-0 /bin/bash -c "nvidia-smi" | ||
- run: docker run --rm -v "$PWD":/src:ro -w /src --gpus all --privileged spaceandtimelabs/blitzar:12.2.0-cuda-1.71.1-rust-0 /bin/bash -c "cp -av /src/ /src_tmp/; cd /src_tmp; /root/.cargo/bin/cargo test --features gpu" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
IMAGE=spaceandtimelabs/blitzar:12.2.0-cuda-1.71.1-rust-0 | ||
|
||
# If you don't have a GPU instance configured in your machine | ||
docker run -v "$PWD":/src -w /src --privileged -it "$IMAGE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
IMAGE=spaceandtimelabs/blitzar:12.2.0-cuda-1.71.1-rust-0 | ||
|
||
# If you have a GPU instance configured in your machine | ||
docker run -v "$PWD":/src -w /src --gpus all --privileged -it "$IMAGE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters