mirror of
https://gitlab.com/KevinRoebert/ClearUrls
synced 2025-12-16 06:05:37 +07:00
116 lines
2.5 KiB
YAML
116 lines
2.5 KiB
YAML
image: debian:latest
|
|
|
|
before_script:
|
|
- export DEBIAN_FRONTEND= noninteractive
|
|
- apt-get update -y
|
|
- apt-get install -y zip unzip nodejs jsonlint
|
|
|
|
# This folder is cached between builds
|
|
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
|
|
cache:
|
|
paths:
|
|
- node_modules/
|
|
stages:
|
|
- install
|
|
- test
|
|
- build
|
|
# - deploy
|
|
|
|
# test rules:
|
|
# stage: test
|
|
# script:
|
|
# - jsonlint-php data/data.min.json
|
|
# only:
|
|
# changes:
|
|
# - data/data.min.json
|
|
#
|
|
# hash rules:
|
|
# stage: build
|
|
# script:
|
|
# - sha256sum data/data.min.json | awk '{print $1}' > rules.min.hash
|
|
# - node build_tools/minifyDataJSON.js "data/data.min.json" "data.minify.json"
|
|
# - sha256sum data.minify.json | awk '{print $1}' > rules.minify.hash
|
|
# artifacts:
|
|
# paths:
|
|
# - rules.min.hash
|
|
# - data.minify.json
|
|
# - rules.minify.hash
|
|
# only:
|
|
# refs:
|
|
# - merge_requests
|
|
# - master
|
|
# changes:
|
|
# - data/data.min.json
|
|
|
|
install dependencies:
|
|
image: node:latest
|
|
stage: install
|
|
script:
|
|
- npm install
|
|
|
|
test:lint:
|
|
image: node:latest
|
|
stage: test
|
|
dependencies:
|
|
- install dependencies
|
|
script:
|
|
- npm run lint
|
|
|
|
test:vulnerabilities:
|
|
image: node:latest
|
|
stage: test
|
|
dependencies:
|
|
- install dependencies
|
|
script:
|
|
- npm audit
|
|
|
|
test:addon:
|
|
image: node:latest
|
|
stage: test
|
|
dependencies:
|
|
- install dependencies
|
|
script:
|
|
- npm run test:ci
|
|
coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
|
|
artifacts:
|
|
when: always
|
|
paths:
|
|
- coverage
|
|
reports:
|
|
junit: junit.xml
|
|
expire_in: 30 days
|
|
|
|
bundle addon:
|
|
stage: build
|
|
script:
|
|
- zip ClearURLs -r -FS distribution/*
|
|
only:
|
|
- master
|
|
artifacts:
|
|
paths:
|
|
- ClearURLs.zip
|
|
|
|
# pages:
|
|
# stage: deploy
|
|
# script:
|
|
# - mkdir public
|
|
# - mkdir public/data
|
|
# - mv GitLabPages/* public/
|
|
# - cp img/clearurls.svg public/clearurls.svg
|
|
# - cp data/data.min.json public/data/data.min.json
|
|
# - sha256sum public/data/data.min.json | awk '{print $1}' > public/data/rules.min.hash
|
|
# - node build_tools/minifyDataJSON.js "public/data/data.min.json" "public/data/data.minify.json"
|
|
# - sha256sum public/data/data.minify.json | awk '{print $1}' > public/data/rules.minify.hash
|
|
# artifacts:
|
|
# paths:
|
|
# - public
|
|
# only:
|
|
# refs:
|
|
# - merge_requests
|
|
# - master
|
|
# changes:
|
|
# - GitLabPages/*
|
|
# - img/clearurls.svg
|
|
# - data/data.min.json
|
|
# - build_tools/minifyDataJSON.js
|