[gjs: 6/15] CI: Switch eslint job to a ready-made Docker image



commit f0a99cbc5494abc7a12636744f1beb660e2a94a4
Author: Philip Chimento <philip chimento gmail com>
Date:   Sat Sep 7 18:46:01 2019 -0700

    CI: Switch eslint job to a ready-made Docker image
    
    Since we fixed all the eslint errors, we no longer need to have the
    custom code comparing HEAD to master for eslint. We can just use a
    ready-made Docker image.

 .gitlab-ci.yml                               | 16 +++++++++-------
 .lint-condo.yaml                             |  3 +++
 test/extra/Dockerfile.fedora.static-analysis |  3 +--
 test/test-ci.sh                              | 24 ------------------------
 4 files changed, 13 insertions(+), 33 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ea9f72e9..35c2f698 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -212,15 +212,17 @@ cpplint:
     - tags
 
 eslint:
-  <<: *build
+  when: on_success
+  image: singapore/lint-condo
   stage: source_check
-  image: registry.gitlab.gnome.org/gnome/gjs:fedora.static-analysis
-  variables:
-    TASK_ID: "eslint"
-    CODECHECK: "ESLINT"
+  script:
+    - node /usr/src/lint-condo
   except:
-    - schedules
-    - tags
+    refs:
+      - schedules
+      - tags
+    variables:
+      - $CI_COMMIT_MESSAGE =~ /\[skip eslint\]/
 
 #############################################
 #                Manual Jobs                #
diff --git a/.lint-condo.yaml b/.lint-condo.yaml
new file mode 100644
index 00000000..6da1d58c
--- /dev/null
+++ b/.lint-condo.yaml
@@ -0,0 +1,3 @@
+---
+linters:
+  - eslint . --format unix
diff --git a/test/extra/Dockerfile.fedora.static-analysis b/test/extra/Dockerfile.fedora.static-analysis
index 92bde459..7beeefca 100644
--- a/test/extra/Dockerfile.fedora.static-analysis
+++ b/test/extra/Dockerfile.fedora.static-analysis
@@ -6,10 +6,9 @@ LABEL version="1.0"
 LABEL description="Docker image to run CI for GNOME GJS (JavaScript bindings for GNOME)."
 
 RUN dnf -y --nogpgcheck upgrade && \
-    dnf -y install git cppcheck nodejs python-devel && \
+    dnf -y install git cppcheck python-devel && \
     mkdir -p /cwd && \
     pip install cpplint && \
-    npm install -g eslint && \
     dnf -y clean all && \
     rm -rf /var/cache/dnf
 
diff --git a/test/test-ci.sh b/test/test-ci.sh
index fceef926..d18b321e 100755
--- a/test/test-ci.sh
+++ b/test/test-ci.sh
@@ -268,30 +268,6 @@ elif [[ $1 == "CPPLINT"  && "$log_message" != *'[skip cpplint]'* ]]; then
 
     # Compare the report with master and fail if new warnings are found
     do_Compare_With_Upstream_Master "cppLint"
-
-elif [[ $1 == "ESLINT" && "$log_message" != *'[skip eslint]'* ]]; then
-    do_Print_Labels 'Javascript Linter report'
-
-    tmp_path=$(dirname "$CI_PROJECT_DIR")
-
-    eslint examples installed-tests modules --format unix 2>&1 | \
-        tee "$save_dir"/analysis/current-report.txt | \
-        sed -E -e 's/:[0-9]+:[0-9]+:/:LINE:COL:/' -e 's/[0-9]+ problems//' -e 's/\/root\/tmp-upstream//' -e 
"s,$tmp_path,," \
-        > /cwd/current-report.txt
-        cat "$save_dir"/analysis/current-report.txt
-    echo
-
-    # Get the code committed at upstream master
-    do_Get_Upstream_Master "esLint"
-    cp "$save_dir"/.eslint* .
-    eslint examples installed-tests modules --format unix 2>&1 | \
-        tee "$save_dir"/analysis/master-report.txt | \
-        sed -E -e 's/:[0-9]+:[0-9]+:/:LINE:COL:/' -e 's/[0-9]+ problems//' -e 's/\/root\/tmp-upstream//' -e 
"s,$tmp_path,," \
-        > /cwd/master-report.txt
-    echo
-
-    # Compare the report with master and fail if new warnings are found
-    do_Compare_With_Upstream_Master "esLint"
 fi
 
 # Releases stuff and finishes


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]