-
Notifications
You must be signed in to change notification settings - Fork 150
/
.gitlab-ci-rules.yml
66 lines (62 loc) · 2.22 KB
/
.gitlab-ci-rules.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
image: stamus/stamus-docker-qa:chromium
npm:
image: node:18.13
stage: build
artifacts:
expire_in: 1 day
paths:
- rules/static/dist
- rules/static/bundles
- rules/static/webpack-stats.prod.json
before_script:
- echo "skip"
script:
- npm install
- ./node_modules/webpack/bin/webpack.js
npm-ui:
variables:
CYPRESS_CACHE_FOLDER: /tmp/cyress_cache # see https://github.com/cypress-io/cypress/issues/1281
image: node:18.13
stage: build
artifacts:
expire_in: 1 day
paths:
- rules/static/dist
- rules/static/bundles
- rules/static/webpack-stats-ui.prod.json
- ui/node_modules
before_script:
- echo "skip"
script:
- cd ui
- 'test -e .env ||: && set -a && source .env && set +a' # load and export env variables
- npm install --unsafe-perms # unsafe-perms required by cypress, see https://github.com/cypress-io/cypress/issues/1281
- npm run build
- node node_modules/eslint/bin/eslint.js app/ --max-warnings 0
- cd "$CI_PROJECT_DIR" && mv ui/webpack-stats-ui.prod.json rules/static/
npm-ui-eslint:
variables:
CYPRESS_CACHE_FOLDER: /tmp/cyress_cache # see https://github.com/cypress-io/cypress/issues/1281
image: node:18.13
stage: build
before_script:
- echo "skip"
script:
- cd ui
- 'test -e .env ||: && set -a && source .env && set +a' # load and export env variables
- npm install --unsafe-perms # unsafe-perms required by cypress, see https://github.com/cypress-io/cypress/issues/1281
- npm run eslint:fix
- git diff --exit-code
test-static:
stage: test
script:
- /home/admin/venv/bin/pylint --load-plugins pylint_django -E -d unexpected-keyword-arg,no-member,access-member-before-definition,no-name-in-module,import-error,imported-auth-user,django-not-configured */*.py
- PYTHONIOENCODING="UTF-8" ./tests/check_non_ascii_chars.py
test-dlint:
image: python
before_script:
- python -m pip install dlint
script:
- python -m flake8 --select=DUO rules
- python -m flake8 --select=DUO suricata
- python -m flake8 --ignore=E501,E722,W504 --exclude=rules/migrations,rules/south_migrations,tests/docker/,accounts/south_migrations,suricata/south_migrations,suricata/migrations rules suricata accounts scirius