Improve CI

This commit is contained in:
Romain Vigier
2021-08-17 19:41:07 +02:00
parent dab2d306be
commit f7a81a421b
2 changed files with 57 additions and 20 deletions
+2 -2
View File
@@ -1,9 +1,9 @@
# SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
# SPDX-License-Identifier: GPL-3.0-or-later
.cache
build
node_modules
**/*.ui~
tests/**/_variants.js
+55 -18
View File
@@ -9,33 +9,70 @@ workflow:
- if: $CI_PIPELINE_SOURCE == "web"
stages:
- test
- check
- build
test:
stage: test
image: node:latest
rules:
- changes:
- src/**/*
- tests/**/*
.python:
image: python:latest
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
key: python
paths:
- .cache/pip
- venv/
before_script:
- python -V
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
.node:
image: node:latest
cache:
key: node
paths:
- node_modules
script:
- npm install
- npm run test
before_script:
- npm install --save-dev
build:
stage: build
image: registry.gitlab.com/rmnvgr/nightthemeswitcher-gnome-shell-extension:latest
lint:
extends: .node
stage: check
interruptible: true
rules:
- if: $CI_COMMIT_TAG
- if: $CI_PIPELINE_SOURCE == "web"
- changes:
- src/**/*.js
- tests/**/*.js
script:
- npm run test-lint
variants:
extends: .node
stage: check
interruptible: true
rules:
- changes:
- tests/**/*.js
script:
- npm run test-variants
reuse:
extends: .python
stage: check
interruptible: true
script:
- pip install reuse
- reuse lint
extension:
stage: build
interruptible: true
image: registry.gitlab.com/rmnvgr/nightthemeswitcher-gnome-shell-extension:latest
script:
- make build
artifacts:
name: "$CI_COMMIT_REF_NAME"
expose_as: "extension"
name: $CI_COMMIT_REF_NAME
expose_as: Extension
paths:
- build/nightthemeswitcher@romainvigier.fr.shell-extension.zip