Skip to content

Commit 38c4973

Browse files
committed
Add building Rust based and restoring/saving cache based on https://circleci.com/orbs/registry/orb/brownjohnf/rust
1 parent eee866b commit 38c4973

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

.circleci/config.yml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,37 @@ executors:
1010
jobs:
1111
build:
1212
executor: docker
13+
parameters:
14+
release:
15+
type: boolean
16+
default: false
1317
steps:
18+
- install_deps
19+
- checkout
20+
- restore_cache:
21+
keys:
22+
- cargo-cache-v1-{{ arch }}-{{ checksum "./Cargo.lock" }}
23+
- cargo-cache-v1-{{ arch }}
1424
- run:
15-
name: The First Step
25+
name: Build
1626
command: |
17-
echo 'Hello world!'
18-
echo 'This is the delivery pipeline'
27+
if [ "<<parameters.release" == "true" ]; then
28+
cargo build --release
29+
cargo test --release
30+
else
31+
cargo build
32+
cargo test
33+
fi
34+
- save_cache:
35+
key: cargo-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "./Cargo.lock" }}
36+
paths:
37+
- ./target
38+
commands:
39+
install_deps:
40+
steps:
41+
- run:
42+
name: Install deps
43+
command: |
44+
apt-get update -qq
45+
apt-get install -y gcc libegl1-mesa-dev libgles2-mesa-dev
1946

0 commit comments

Comments
 (0)