diff --git a/.gitignore b/.gitignore index 509959f..b2baa1e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,9 @@ # SPDX-FileCopyrightText: 2021 Romain Vigier # SPDX-License-Identifier: GPL-3.0-or-later +.cache + build node_modules -**/*.ui~ - tests/**/_variants.js diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ffb92c4..835110a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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