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-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
.cache
build build
node_modules node_modules
**/*.ui~
tests/**/_variants.js tests/**/_variants.js
+55 -18
View File
@@ -9,33 +9,70 @@ workflow:
- if: $CI_PIPELINE_SOURCE == "web" - if: $CI_PIPELINE_SOURCE == "web"
stages: stages:
- test - check
- build - build
test: .python:
stage: test image: python:latest
image: node:latest variables:
rules: PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
- changes:
- src/**/*
- tests/**/*
cache: 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: paths:
- node_modules - node_modules
script: before_script:
- npm install - npm install --save-dev
- npm run test
build: lint:
stage: build extends: .node
image: registry.gitlab.com/rmnvgr/nightthemeswitcher-gnome-shell-extension:latest stage: check
interruptible: true
rules: rules:
- if: $CI_COMMIT_TAG - changes:
- if: $CI_PIPELINE_SOURCE == "web" - 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: script:
- make build - make build
artifacts: artifacts:
name: "$CI_COMMIT_REF_NAME" name: $CI_COMMIT_REF_NAME
expose_as: "extension" expose_as: Extension
paths: paths:
- build/nightthemeswitcher@romainvigier.fr.shell-extension.zip - build/nightthemeswitcher@romainvigier.fr.shell-extension.zip