misc/collect.py: better error messages
[web/firmware-selector-openwrt-org.git] / .gitlab-ci.yml
1 include:
2 - local: '.gitlab/ci/prebuild.yml'
3 - remote: https://gitlab.com/ynezz/openwrt-ci/raw/master/openwrt-ci/gitlab/main.yml
4
5 stages:
6 - pre-build
7 - test
8
9 check HTML, JS, CSS with eslint and prettier:
10 stage: pre-build
11 image: node
12 cache:
13 paths:
14 - node_modules/
15 script:
16 - yarn install
17 - yarn prettier --check www/
18 - yarn eslint www/
19
20 check HTML, CSS and SVG with html5validator:
21 stage: pre-build
22 image: cyb3rjak3/html5validator:latest
23 script:
24 - html5validator --root www --also-check-css --show-warnings --log INFO
25
26 .build python:
27 stage: pre-build
28 image: python:$CI_PYTHON_VERSION-slim-buster
29 before_script:
30 - apt-get update; apt-get install -y make
31 script:
32 - cp -R ./www ./build
33 - misc/collect.py scrape https://downloads.openwrt.org build
34 artifacts:
35 expire_in: 1 week
36 when: always
37 paths:
38 - build
39
40 build site on Python 3.6:
41 extends: .build python
42 variables:
43 CI_PYTHON_VERSION: "3.6"
44
45 build site on Python 3.8:
46 extends: .build python
47 variables:
48 CI_PYTHON_VERSION: "3.8"
49
50 .build site:
51 stage: pre-build
52 image: debian:9
53 before_script:
54 - apt-get update; apt-get install -y make python3 ca-certificates
55 artifacts:
56 expire_in: 1 week
57 when: always
58 paths:
59 - build
60
61 build site for target environment using scrape method:
62 extends: .build site
63 script:
64 - cp -R ./www ./build
65 - misc/collect.py scrape https://downloads.openwrt.org build
66
67 build site for target environment using scan method:
68 extends: .build site
69 script:
70 - cp -R ./www ./build
71 - misc/collect.py scan downloads.openwrt.org tests/profiles build
72
73 .test site:
74 stage: test
75 image: selenium/standalone-firefox:latest
76 script:
77 - /opt/bin/entry_point.sh &
78 - sudo apt-get update; sudo apt-get install -y python3-pip python3-pytest
79 - pip3 install selenium-firefox
80 - (cd build; python3 -m http.server &)
81 - pytest-3 tests
82
83 test scraped site with selenium:
84 extends: .test site
85 dependencies:
86 - build site for target environment using scrape method
87
88 test scaned site with selenium:
89 extends: .test site
90 dependencies:
91 - build site for target environment using scan method