From 9892fdf0f050eea6caa068d0b7935cce7bbf67f9 Mon Sep 17 00:00:00 2001
From: Emanuele Aina <emanuele.aina@collabora.com>
Date: Mon, 5 Oct 2020 15:15:19 +0200
Subject: [PATCH] gitlab-ci: Reduce cost and latency of jobs

Add the `lightweight` tag to run jobs on the GitLab runners set up for
jobs that do not need large amounts of resources (max 2GB of RAM) and do
not need privileged containers.

The former makes jobs cheaper because they user smaller VM instance
types, the latter improves latency as there's no strong need to spin
separate VMs to keep each job isolated and existing instances can be
re-used instead.

Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com>
---
 .gitlab-ci.yml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 513111bc0..3ef584b9b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -14,6 +14,8 @@ stages:
 test-html:
   image: registry.gitlab.com/pages/hugo:0.62.2
   stage: generate-html
+  tags:
+    - lightweight
   script:
   - DEFAULT_BASEURL=${CI_PAGES_URL##http:} # don't force stuff on plain HTTP when publishing on HTTPS
   - BASEURL=${BASEURL:-$DEFAULT_BASEURL} # set BASEURL in the CI variables to override it
@@ -26,6 +28,8 @@ test-html:
 .gen-pdf:
   image: docker-registry.apertis.org/apertis/apertis-v2020-documentation-builder
   stage: generate-pdf
+  tags:
+    - lightweight
   script:
   - echo "Building PDFs on $(nproc) cores"
   - find public -name "*.pdf-in" -print0 | xargs -0 -r -n1 -P "$(nproc)" scripts/create-pdf
-- 
GitLab