From ac6aba0a07fb445cfcce6b556667195b6bd159e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Wed, 5 Jan 2022 07:50:24 +0100 Subject: [PATCH] Add cache in rebuild --- .github/workflows/rebuild.yaml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rebuild.yaml b/.github/workflows/rebuild.yaml index ed552976..b2c7d2a7 100644 --- a/.github/workflows/rebuild.yaml +++ b/.github/workflows/rebuild.yaml @@ -5,6 +5,9 @@ on: schedule: - cron: '30 2 * * *' +env: + DOCKER_BUILDKIT: '1' + jobs: main: runs-on: ubuntu-20.04 @@ -40,8 +43,30 @@ jobs: - name: Checks run: c2cciutils-checks - - run: make pull - - run: make build + - name: Cache + uses: actions/cache@v2 + with: + key: docker-cache + path: /tmp/docker/cache + - name: Fill the cache + run: | + mkdir -p /tmp/docker/cache/.ccache + mkdir cache + cp -ar /tmp/docker/cache/.ccache cache + touch cache/.ccache/a-file + docker build --file=Dockerfile-fillcache . + rm -rf cache + + - run: make build-server + - run: make build-desktop + - run: make build-cache + + - name: Extract cache + run: | + docker run --rm --detach --name=cache qgis-cache + docker cp cache:/.ccache /tmp/docker/cache + docker stop cache + - run: make run - run: make acceptance - run: (cd acceptance_tests; docker-compose logs)