remove safari specific attribute to please the linter
[web/firmware-selector-openwrt-org.git] / .gitlab-ci.yml
index 5a01f2290d7233138ed2ca0b6a725f324604f5a7..a7c5a87aaf08342b7075efee6e672f6c12f0f558 100644 (file)
@@ -6,8 +6,62 @@ stages:
   - pre-build
   - test
 
+check HTML, JS, CSS with eslint and prettier:
+  stage: pre-build
+  image: node
+  cache:
+    paths:
+      - node_modules/
+  script:
+    - yarn install
+    - yarn prettier --check www/
+    - yarn eslint www/
+
 check HTML, CSS and SVG with html5validator:
   stage: pre-build
   image: cyb3rjak3/html5validator:latest
   script:
     - html5validator --root www --also-check-css --also-check-svg --show-warnings --log INFO
+
+.build python:
+  stage: pre-build
+  image: python:$CI_PYTHON_VERSION-slim-buster
+  before_script:
+    - apt-get update; apt-get install -y make
+  script:
+    - cp -R ./www ./build
+    - misc/collect.py scrape https://downloads.openwrt.org build
+  artifacts:
+    expire_in: 1 week
+    when: always
+    paths:
+      - build
+
+build site on Python 3.6:
+  extends: .build python
+  variables:
+    CI_PYTHON_VERSION: "3.6"
+
+build site on Python 3.8:
+  extends: .build python
+  variables:
+    CI_PYTHON_VERSION: "3.8"
+
+test site with selenium:
+  stage: test
+  image: selenium/standalone-firefox:latest
+  script:
+    - /opt/bin/entry_point.sh &
+    - sudo apt-get update; sudo apt-get install -y python3-pip python3-pytest
+    - pip3 install selenium-firefox
+    - (cd build; python3 -m http.server &)
+    - pytest-3 tests
+
+build site for target environment:
+  stage: test
+  image: debian:9
+  before_script:
+    - apt-get update; apt-get install -y make python3
+  script:
+    - cp -R ./www ./build
+    - misc/collect.py scrape https://downloads.openwrt.org build