Use Node image for test stage and only build for tags
This commit is contained in:
+11
-15
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user