Skip to content

Commit

Permalink
Merge pull request #8 from KnpLabs/fix/circleci-cache
Browse files Browse the repository at this point in the history
[RFR] fix circleci cache archive
  • Loading branch information
nm2107 authored Dec 23, 2019
2 parents 94436a4 + e966471 commit a56fa16
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
15 changes: 12 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,22 @@ reference:
restore_cache_step: &restore_cache_step
restore_cache:
keys:
- cargo-{{ checksum "Cargo.lock" }}
- cargo-
- cargo-v3-{{ checksum "Cargo.lock" }}
- cargo-v3-

enlight_cache_step: &enlight_cache_step
run:
name: Enlight cache
# @see https://docs.travis-ci.com/user/languages/rust/#dependency-management
# Use sudo due to the different uid between circleci user and docker user
command: sudo rm -rf .cargo/registry/src

save_cache_step: &save_cache_step
save_cache:
key: cargo-{{ checksum "Cargo.lock" }}
key: cargo-v3-{{ checksum "Cargo.lock" }}
paths:
- .cargo/
- target/

build_docker_image_step: &build_docker_image_step
run:
Expand Down Expand Up @@ -66,6 +74,7 @@ jobs:
- <<: *chown_working_directory_step
- <<: *run_unit_tests_step
- <<: *run_functional_tests_step
- <<: *enlight_cache_step
- <<: *save_cache_step

release_job:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
TEST_FLAGS ?=

ifneq (,$(CI))
TEST_FLAGS=--release
endif

.PHONY: build
build:
docker-compose build
Expand All @@ -16,11 +22,11 @@ build-release:
.PHONY: test-unit
test-unit:
docker-compose run --rm app \
cargo test --tests \
cargo test --tests $(TEST_FLAGS) \
-p ci \
# add the other packages to test with the -p flag

.PHONY: test-functional
test-functional:
docker-compose run --rm app \
cargo test --tests
cargo test --tests $(TEST_FLAGS)

0 comments on commit a56fa16

Please sign in to comment.