Use Node image for test stage and only build for tags

This commit is contained in:
Romain Vigier
2020-08-10 10:39:46 +02:00
parent f02a3de8db
commit 2aaa38af01
+11 -15
View File
@@ -15,40 +15,36 @@
# this program. If not, see <http s ://www.gnu.org/licenses/>.
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"