How to use caching in circleci

version: 2
jobs:
build:
docker:
- image: allinone:latest
steps:
- checkout
- restore_cache:
key: -v3-{{ checksum “requirements.txt”}}
- run:
name: Install Requests
command: python3.6 -m pip install requests
- run:
name: Get Models
command: git clone https://github.com/circulosmeos/gdown.pl && cd gdown.pl && ./gdown.pl https://drive.google.com/file/d/11v9D6lyMhTlzGPMXTia_iUzv-3AdEGK5/view?usp=sharing model.tar.xz && tar xvf model.tar.xz && cd model
- run:
name: install GRPC
command: python3.6 -m pip install grpcio grpcio-tools
- run:
name: Generate GRPC files
command: cd grpc && python3.6 -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. grpc/all_in_one.proto
- run:
name: Run Tests
command: python3.6 -m unittest test_rpc_call.TestSuiteGrpc
- save_cache:
paths:
- null
key: -v3-{{checksum “requirements.txt”}}

workflows:
version: 2
build_and_test:
jobs:
- build
I have this circleci file in my config.yml and I want to store cache in a file named requirements.txt Every time I run circleci local execute --job build it is running from scratch all the commands but I want to use cache like docker build how can I do that?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.