Browse Source

feat(ci) test config.js syntax with Duktape 2.2.1

This is the version we evaluate config.js with on Android, making it the
lowest common denominator. While being a nifty little engine, it suffers
from not being fully ES6 compliant, so things like arrow functions or
template strings are not implemented.
Saúl Ibarra Corretgé 2 months ago
parent
commit
c05cdead34
1 changed files with 13 additions and 1 deletions
  1. 13 1
      .github/workflows/ci.yml

+ 13 - 1
.github/workflows/ci.yml

@@ -27,12 +27,24 @@ jobs:
         esac
         wget -qO /tmp/tpl https://github.com/jitsi/tpl/releases/latest/download/tpl-linux-${TPL_ARCH}
         chmod +x /tmp/tpl
+    - name: setup duktape
+      working-directory: /tmp
+      run: |
+        wget https://duktape.org/duktape-2.2.1.tar.xz
+        tar xvf duktape-2.2.1.tar.xz
+        cd duktape-2.2.1
+        make -f Makefile.cmdline
+        mv duk /usr/local/bin
     - name: Run tpl with default values for web
+      env:
+        P2P_STUN_SERVERS: stun.l.google.com:19302,stun1.l.google.com:19302,stun2.l.google.com:19302
       run:  |
         /tmp/tpl web/rootfs/defaults/system-config.js > /tmp/config.js
         /tmp/tpl web/rootfs/defaults/settings-config.js >> /tmp/config.js
+        echo "console.log(JSON.stringify(config, undefined, 2));" >> /tmp/config.js
+        cat /tmp/config.js
     - name: Check config.js syntax
-      run: node /tmp/config.js
+      run: duk /tmp/config.js
     - name: Run tpl with default values for jvb
       run:  |
         /tmp/tpl jvb/rootfs/defaults/jvb.conf > /tmp/jvb.conf