From fda43e34642e59e7652e29d8b99859e38ad531ba Mon Sep 17 00:00:00 2001
From: Arkerthan <arkerthan@gmail.com>
Date: Thu, 10 Dec 2020 21:24:23 +0100
Subject: [PATCH] Add gitlab CI with eslint check

---
 .gitlab-ci.yml | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 .gitlab-ci.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 00000000000..9561b0cf61a
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,19 @@
+stages:
+  - lint
+
+eslint:
+  stage: lint
+  #image: node:current-alpine3.12
+  image: node:12-alpine3.12
+  tags: [ docker ]
+  script:
+    - npm install
+    #- npm ci ### should use this for automated testing instead of "npm install", but we need a package-lock.json for it.
+    - npm install eslint-formatter-gitlab
+    - npx eslint --format gitlab .
+  # errors make eslint return 1, for now though we want the pipeline not to ail when we eslint errors.
+  # trying to add " ; exit 0" or " ; echo 0" let the build fail anyways for some reason.
+  allow_failure: true
+  artifacts:
+    reports:
+      codequality: gl-codequality.json
-- 
GitLab