Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate test job from github to circle ci
- Loading branch information
Showing
2 changed files
with
128 additions
and
116 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,128 @@ | ||
version: 2.1 | ||
|
||
executors: | ||
rust-stable: | ||
docker: | ||
- image: inputoutput/rust:stable | ||
working_directory: /home/circleci/build | ||
|
||
jobs: | ||
cargo_fetch: | ||
executor: rust-stable | ||
steps: | ||
- checkout | ||
- run: git --version | ||
- run: | ||
name: Get top commit hash of cargo registry index | ||
command: | | ||
git ls-remote --heads https://github.com/rust-lang/crates.io-index.git master | | ||
cut -f 1 | tee .circleci/crates.io-index.head | ||
- restore_cache: | ||
name: Restore cargo registry index from cache | ||
keys: | ||
- cargo-index-v1-{{ checksum ".circleci/crates.io-index.head" }} | ||
- cargo-index-v1- | ||
- restore_cache: | ||
name: Restore dependency crates from cache | ||
keys: | ||
- cargo-deps-v2-{{ checksum "Cargo.lock" }} | ||
- run: | ||
name: Fetch dependencies and update cargo registry index | ||
command: | | ||
cargo fetch | ||
git -C /usr/local/cargo/registry/index/github.com-1ecc6299db9ec823 \ | ||
show-ref -s refs/remotes/origin/master | | ||
tee .circleci/crates.io-index.head | ||
- save_cache: | ||
name: Save cargo registry index into cache | ||
key: cargo-index-v1-{{ checksum ".circleci/crates.io-index.head" }} | ||
paths: | ||
- /usr/local/cargo/registry/index | ||
- save_cache: | ||
name: Save dependency crates into cache | ||
key: cargo-deps-v2-{{ checksum "Cargo.lock" }} | ||
paths: | ||
- /usr/local/cargo/registry/cache | ||
- /usr/local/cargo/git/db | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- .circleci/crates.io-index.head | ||
|
||
test_debug: | ||
executor: rust-stable | ||
environment: | ||
RUSTFLAGS: -D warnings | ||
CARGO_INCREMENTAL: 0 | ||
steps: | ||
- test | ||
|
||
commands: | ||
test: | ||
description: "Steps for the test jobs" | ||
parameters: | ||
mode: | ||
type: string | ||
default: '' | ||
cargo_behavior: | ||
type: string | ||
default: --verbose | ||
steps: | ||
- checkout | ||
- attach_workspace: | ||
at: . | ||
- restore_cache: | ||
name: Restore cargo registry index from cache | ||
keys: | ||
- cargo-index-v1-{{ checksum ".circleci/crates.io-index.head" }} | ||
- restore_cache: | ||
name: Restore dependency crates from cache | ||
keys: | ||
- cargo-deps-v2-{{ checksum "Cargo.lock" }} | ||
- run: | ||
name: Print version information | ||
command: rustc --version; cargo --version | ||
- run: | ||
name: checkout jormungandr | ||
command: | | ||
git clone https://github.com/input-output-hk/jormungandr.git | ||
- run: | ||
name: install jormungandr | ||
command: | | ||
cd jormungandr | ||
cargo install --path jormungandr | ||
- run: | ||
name: checkout vit-station-service | ||
command: | | ||
git clone | ||
https://github.com/input-output-hk/vit-servicing-station.git | ||
- run: | ||
name: install jormungandr | ||
command: | | ||
cd vit-servicing-station | ||
cargo install --path vit-servicing-station-server | ||
- run: | ||
name: install iapyx | ||
command: | | ||
cd vit-servicing-station | ||
cargo install --path vit-servicing-station-server | ||
- run: | ||
name: install iapyx utils | ||
command: | | ||
cd iapyx | ||
cargo install --path iapyx | ||
- run: | ||
name: Run tests | ||
environment: | ||
RUST_BACKTRACE: 1 | ||
command: | | ||
cargo test | ||
workflows: | ||
version: 2 | ||
test_all: | ||
jobs: | ||
- cargo_fetch | ||
- test_debug: | ||
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