Cache dependencies to speed up GitHub Action workflows (#3501)

* Cache dependencies to speed up workflows

Signed-off-by: quicksilver <zhifeng.zhang@zilliz.com>

* Cache dependencies to speed up workflows

Signed-off-by: quicksilver <zhifeng.zhang@zilliz.com>
pull/3519/head
quicksilver 2020-08-29 10:02:55 +08:00 committed by GitHub
parent 8f26e69f46
commit 3f8181060d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 13 deletions

View File

@ -50,6 +50,12 @@ jobs:
run: |
docker-compose build ubuntu-core
docker rmi $(docker images | grep '<none>' | awk '{print $3}') || exit 0
- name: Cache Docker Volumes
uses: actions/cache@v1
with:
path: .docker
key: ubuntu${{ matrix.ubuntu }}-${{ hashFiles('core/**') }}
restore-keys: ubuntu${{ matrix.ubuntu }}-
- name: Docker Run
run: |
docker-compose run ubuntu-core
@ -96,6 +102,12 @@ jobs:
run: |
docker-compose build centos-core
docker rmi $(docker images | grep '<none>' | awk '{print $3}') || exit 0
- name: Cache Docker Volumes
uses: actions/cache@v1
with:
path: .docker
key: centos${{ matrix.centos }}-${{ hashFiles('core/**') }}
restore-keys: centos${{ matrix.centos }}-
- name: Docker Run
run: |
docker-compose run centos-core

View File

@ -1,17 +1,11 @@
version: '3.5'
volumes:
amd64-ubuntu-18.04-cache:
amd64-centos-7-cache:
amd64-ubuntu-18.04-cuda-cache:
amd64-centos-7-cuda-cache:
x-ccache: &ccache
CCACHE_COMPILERCHECK: content
CCACHE_COMPRESS: 1
CCACHE_COMPRESSLEVEL: 5
CCACHE_MAXSIZE: 2G
CCACHE_DIR: /build/ccache
CCACHE_DIR: /ccache
services:
ubuntu-core:
@ -26,7 +20,7 @@ services:
<<: *ccache
volumes: &ubuntu-volumes
- .:/milvus:delegated
- ${ARCH}-ubuntu-${UBUNTU}-cache:/build:delegated
- ${DOCKER_VOLUME_DIRECTORY:-.docker}/${ARCH}-ubuntu-${UBUNTU}-cache:/ccache:delegated
networks:
- milvus
command: &ubuntu-command
@ -45,7 +39,7 @@ services:
<<: *ccache
volumes: &centos-volumes
- .:/milvus:delegated
- ${ARCH}-centos-${CENTOS}-cache:/build:delegated
- ${DOCKER_VOLUME_DIRECTORY:-.docker}/${ARCH}-centos-${CENTOS}-cache:/ccache:delegated
networks:
- milvus
command: &centos-command
@ -64,7 +58,7 @@ services:
<<: *ccache
volumes: &ubuntu-cuda-volumes
- .:/milvus:delegated
- ${ARCH}-ubuntu-${UBUNTU}-cuda-cache:/build:delegated
- ${DOCKER_VOLUME_DIRECTORY:-.docker}/${ARCH}-ubuntu-${UBUNTU}-cuda-cache:/ccache:delegated
networks:
- milvus
command: &ubuntu-cuda-command
@ -82,7 +76,7 @@ services:
<<: *ccache
volumes: &centos-cuda-volumes
- .:/milvus:delegated
- ${ARCH}-centos-${CENTOS}-cuda-cache:/build:delegated
- ${DOCKER_VOLUME_DIRECTORY:-.docker}/${ARCH}-centos-${CENTOS}-cuda-cache:/ccache:delegated
networks:
- milvus
command: &centos-cuda-command
@ -98,7 +92,6 @@ services:
shm_size: 2G
volumes:
- .:/milvus:delegated
- ${ARCH}-centos-${CENTOS}-cache:/build:delegated
networks:
- milvus
command:
@ -114,7 +107,6 @@ services:
shm_size: 2G
volumes:
- .:/milvus:delegated
- ${ARCH}-centos-${CENTOS}-cuda-cache:/build:delegated
networks:
- milvus
command: