ci: fix YAML dependency issue
[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 for target environment:
51 stage: pre-build
52 image: debian:9
53 before_script:
54 - apt-get update; apt-get install -y make python3 ca-certificates
55 script:
56 - cp -R ./www ./build
57 - misc/collect.py scrape https://downloads.openwrt.org build
58 artifacts:
59 expire_in: 1 week
60 when: always
61 paths:
62 - build
63
64 test site with selenium:
65 stage: test
66 image: selenium/standalone-firefox:latest
67 dependencies:
68 - build site for target environment
69 script:
70 - /opt/bin/entry_point.sh &
71 - sudo apt-get update; sudo apt-get install -y python3-pip python3-pytest
72 - pip3 install selenium-firefox
73 - (cd build; python3 -m http.server &)
74 - pytest-3 tests