From 2aaa38af01e2e2440f36bb364c81fbdaaf4e1b18 Mon Sep 17 00:00:00 2001 From: Romain Vigier Date: Mon, 10 Aug 2020 10:39:46 +0200 Subject: [PATCH] Use Node image for test stage and only build for tags --- .gitlab-ci.yml | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4bc295d..c2a0b8f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,40 +15,36 @@ # this program. If not, see . -image: fedora:latest - -cache: - paths: - - .dnf_cache - - node_modules - stages: - test - build -before_script: - - mkdir -p .dnf_cache - - dnf --setopt=cachedir=$(pwd)/.dnf_cache --setopt=keepcache=True update -y - - dnf --setopt=cachedir=$(pwd)/.dnf_cache --setopt=keepcache=True install -y make - test: stage: test + image: node:latest rules: - changes: - src/**/* - tests/**/* + cache: + paths: + - node_modules script: - - dnf --setopt=cachedir=$(pwd)/.dnf_cache --setopt=keepcache=True install -y node npm - make deps-install - make test build: stage: build + image: fedora:latest rules: - - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH - if: $CI_COMMIT_TAG + cache: + paths: + - .dnf_cache script: - - dnf --setopt=cachedir=$(pwd)/.dnf_cache --setopt=keepcache=True install -y gnome-shell gettext + - mkdir -p .dnf_cache + - dnf --setopt=cachedir=$(pwd)/.dnf_cache --setopt=keepcache=True update -y + - dnf --setopt=cachedir=$(pwd)/.dnf_cache --setopt=keepcache=True install -y make gnome-shell gettext - make build artifacts: name: "$CI_COMMIT_REF_NAME"