forked from filecoin-project/ec-gpu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
136 additions
and
0 deletions.
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,135 @@ | ||
version: 2.1 | ||
|
||
executors: | ||
default: | ||
machine: | ||
image: ubuntu-1604-cuda-10.1:201909-23 | ||
working_directory: ~/gpuci | ||
resource_class: gpu.nvidia.medium | ||
|
||
restore-workspace: &restore-workspace | ||
attach_workspace: | ||
at: ~/ | ||
|
||
restore-cache: &restore-cache | ||
restore_cache: | ||
keys: | ||
- cargo-v0-{{ checksum "rust-toolchain" }}-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}-{{ arch }} | ||
- repo-source-{{ .Branch }}-{{ .Revision }} | ||
|
||
commands: | ||
test_target: | ||
parameters: | ||
target: | ||
type: string | ||
steps: | ||
- *restore-workspace | ||
- *restore-cache | ||
- run: | ||
name: Test (<< parameters.target >>) | ||
command: TARGET=<< parameters.target >> cargo test | ||
no_output_timeout: 15m | ||
|
||
jobs: | ||
|
||
cargo_fetch: | ||
executor: default | ||
steps: | ||
- checkout | ||
- run: curl https://sh.rustup.rs -sSf | sh -s -- -y | ||
- run: echo 'export PATH="$HOME:~/.cargo/bin:$PATH"' >> $BASH_ENV | ||
- run: echo $BASH_ENV | ||
- run: echo $HOME | ||
- run: source $BASH_ENV | ||
- run: cargo --version | ||
- run: rustc --version | ||
- run: | ||
name: Update submodules | ||
command: git submodule update --init --recursive | ||
- run: | ||
name: Calculate dependencies | ||
command: cargo generate-lockfile | ||
- restore_cache: | ||
keys: | ||
- cargo-v0-{{ checksum "rust-toolchain" }}-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}-{{ arch }} | ||
- run: cargo update | ||
- run: cargo fetch | ||
- run: rustup install $(cat rust-toolchain) | ||
- run: rustup default $(cat rust-toolchain) | ||
- run: rustup component add rustfmt-preview | ||
- run: rustup component add clippy-preview | ||
- run: rustc --version | ||
- run: rm -rf .git | ||
- persist_to_workspace: | ||
root: ~/ | ||
paths: | ||
- gpuci | ||
- save_cache: | ||
key: cargo-v0-{{ checksum "rust-toolchain" }}-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}-{{ arch }} | ||
paths: | ||
- "~/.cargo" | ||
- "~/.rustup" | ||
|
||
test_x86_64-unknown-linux-gnu: | ||
executor: default | ||
steps: | ||
- run: echo 'export PATH="$HOME:~/.cargo/bin:$PATH"' >> $BASH_ENV | ||
- run: source $BASH_ENV | ||
- run: sudo apt-get update -y | ||
- run: apt-cache search opencl | ||
- run: sudo apt install -y ocl-icd-opencl-dev | ||
- test_target: | ||
target: "x86_64-unknown-linux-gnu" | ||
|
||
rustfmt: | ||
executor: default | ||
steps: | ||
- *restore-workspace | ||
- *restore-cache | ||
- run: echo 'export PATH="$HOME:~/.cargo/bin:$PATH"' >> $BASH_ENV | ||
- run: source $BASH_ENV | ||
- run: | ||
name: Run cargo fmt | ||
command: cargo fmt --all -- --check | ||
|
||
clippy: | ||
executor: default | ||
steps: | ||
- *restore-workspace | ||
- *restore-cache | ||
- run: echo 'export PATH="$HOME:~/.cargo/bin:$PATH"' >> $BASH_ENV | ||
- run: source $BASH_ENV | ||
- run: | ||
name: Run cargo clippy | ||
command: cargo clippy --all-features | ||
|
||
build: | ||
executor: default | ||
steps: | ||
- *restore-workspace | ||
- *restore-cache | ||
- run: echo 'export PATH="$HOME:~/.cargo/bin:$PATH"' >> $BASH_ENV | ||
- run: source $BASH_ENV | ||
- run: | ||
name: Run cargo release build | ||
command: cargo build --release | ||
|
||
|
||
workflows: | ||
version: 2.1 | ||
|
||
test: | ||
jobs: | ||
- cargo_fetch | ||
- rustfmt: | ||
requires: | ||
- cargo_fetch | ||
- clippy: | ||
requires: | ||
- cargo_fetch | ||
- test_x86_64-unknown-linux-gnu: | ||
requires: | ||
- cargo_fetch | ||
- build: | ||
requires: | ||
- cargo_fetch |
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 @@ | ||
nightly-2020-01-08 |