ci: cache packages

Results in ~40s saved in each job.

Signed-off-by: Filipe Laíns <lains@archlinux.org>
This commit is contained in:
Filipe Laíns 2020-05-21 00:38:41 +01:00 committed by Allan McRae
parent 40bbaead44
commit e348ba3881

View File

@ -1,12 +1,19 @@
variables: variables:
MAKEFLAGS: "-j10" MAKEFLAGS: "-j10"
VERBOSE: 1 VERBOSE: 1
PACMAN_OPTS: --needed --noconfirm --cachedir .pkg-cache
cache:
key: pkgs-v1
paths:
# For some reason Gitlab CI only supports storing cache/artifacts in a path relative to the build directory
- .pkg-cache
.arch-test: .arch-test:
image: archlinux/base image: archlinux/base
before_script: before_script:
- > - >
pacman -Syu --needed --noconfirm pacman -Syu $PACMAN_OPTS
base-devel git base-devel git
gpgme libarchive curl gpgme libarchive curl
python python
@ -30,14 +37,14 @@ arch-debug:
arch-docs: arch-docs:
extends: .arch-test extends: .arch-test
script: script:
- pacman -Syu --needed --noconfirm asciidoc - pacman -Syu $PACMAN_OPTS asciidoc
- meson -Ddoc=enabled build - meson -Ddoc=enabled build
- ninja -C build - ninja -C build
arch-clang: arch-clang:
extends: .arch-test extends: .arch-test
script: script:
- pacman -Syu --needed --noconfirm clang - pacman -Syu $PACMAN_OPTS clang
- CC=clang meson build - CC=clang meson build
- ninja -C build - ninja -C build
- fakechroot meson test -C build - fakechroot meson test -C build
@ -80,6 +87,7 @@ arch-no-nls:
debian: debian:
image: debian:bullseye image: debian:bullseye
cache: {}
before_script: before_script:
- apt update - apt update
- > - >
@ -95,6 +103,7 @@ debian:
fedora: fedora:
image: fedora image: fedora
cache: {}
before_script: before_script:
- > - >
dnf -y install dnf -y install