Sync workflows with WoltLab/WCF
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 27 Oct 2020 11:11:05 +0000 (12:11 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 27 Oct 2020 11:11:05 +0000 (12:11 +0100)
.github/javascript-syntax.json [new file with mode: 0644]
.github/php-syntax.json
.github/workflows/codestyle.yml
.github/workflows/javascript.yml [new file with mode: 0644]
.github/workflows/php-syntax.yml [deleted file]
.github/workflows/php.yml [new file with mode: 0644]

diff --git a/.github/javascript-syntax.json b/.github/javascript-syntax.json
new file mode 100644 (file)
index 0000000..151a7c6
--- /dev/null
@@ -0,0 +1,15 @@
+{
+  "problemMatcher": [
+    {
+      "owner": "node -c",
+      "pattern": [
+        {
+          "regexp": "^(./\\S+):(\\d+) - (.*)$",
+          "file": 1,
+          "line": 2,
+          "message": 3
+        }
+      ]
+    }
+  ]
+}
index dd45f7914b3d277ba2282b09d8cb3b2337fe5110..c9c573843370e9505177de0ed5ff00753c2487c8 100644 (file)
@@ -1,15 +1,15 @@
 {
   "problemMatcher": [
-      {
-          "owner": "php -l",
-          "pattern": [
-              {
-                  "regexp": "^\\s*(PHP\\s+)?([a-zA-Z\\s]+):\\s+(.*)\\s+in\\s+(\\S+)\\s+on\\s+line\\s+(\\d+)$",
-                  "file": 4,
-                  "line": 5,
-                  "message": 3
-              }
-          ]
-      }
+    {
+      "owner": "php -l",
+      "pattern": [
+        {
+          "regexp": "^\\s*(PHP\\s+)?([a-zA-Z\\s]+):\\s+(.*)\\s+in\\s+(\\S+)\\s+on\\s+line\\s+(\\d+)$",
+          "file": 4,
+          "line": 5,
+          "message": 3
+        }
+      ]
+    }
   ]
 }
index 74d4fd08c72fe70ef39be1630a720b85e78fac0d..964e5360c29b460d4a20ce3767f4b9bd078d4d05 100644 (file)
@@ -10,7 +10,7 @@ on:
 
 jobs:
   php:
-    name: Run PHP CodeSniffer
+    name: PHP CodeSniffer
     runs-on: ubuntu-latest
     steps:
     - uses: actions/checkout@v2
diff --git a/.github/workflows/javascript.yml b/.github/workflows/javascript.yml
new file mode 100644 (file)
index 0000000..c2ef1b5
--- /dev/null
@@ -0,0 +1,31 @@
+name: JavaScript
+
+on:
+  push:
+    branches:
+    - "5.2"
+    - "5.3"
+    - master
+  pull_request:
+
+jobs:
+  syntax:
+    name: "Check Syntax"
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+    steps:
+    - name: Set up node.js
+      uses: actions/setup-node@v1
+      with:
+        node-version: "12"
+    - uses: actions/checkout@v2
+    - run: echo "::add-matcher::.github/javascript-syntax.json"
+    - name: Remove files to be ignored
+      run: |
+        true
+    - run: |
+        ! find . -type f -name '*.js' -exec node -c '{}' \; 2>&1 \
+          |awk 'BEGIN {m=0} /(.js):[0-9]+$/ {m=1; printf "%s - ",$0} m==1 && /^SyntaxError/ { m=0; print }' \
+          |sed "s@$(pwd)@.@" \
+          |grep '^'
diff --git a/.github/workflows/php-syntax.yml b/.github/workflows/php-syntax.yml
deleted file mode 100644 (file)
index 667e9ee..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-name: PHP Syntax Check
-
-on:
-  push:
-    branches:
-    - "5.2"
-    - "5.3"
-    - master
-  pull_request:
-
-jobs:
-  check:
-    runs-on: ubuntu-latest
-    strategy:
-      fail-fast: false
-      matrix:
-        php:
-        - '7.2'
-        - '7.3'
-        - '7.4'
-        - '8.0'
-    steps:
-    - name: Set up PHP
-      uses: shivammathur/setup-php@v2
-      with:
-        php-version: ${{ matrix.php }}
-    - uses: actions/checkout@v2
-    - run: echo "::add-matcher::.github/php-syntax.json"
-    - name: Remove files to be ignored
-      run: |
-        true
-    - run: |
-        ! find . -type f -name '*.php' -exec php -l '{}' \; 2>&1 |grep -v '^No syntax errors detected'
diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml
new file mode 100644 (file)
index 0000000..fe6161e
--- /dev/null
@@ -0,0 +1,34 @@
+name: PHP
+
+on:
+  push:
+    branches:
+    - "5.2"
+    - "5.3"
+    - master
+  pull_request:
+
+jobs:
+  syntax:
+    name: "Check Syntax (${{ matrix.php }})"
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        php:
+        - '7.2'
+        - '7.3'
+        - '7.4'
+        - '8.0'
+    steps:
+    - name: Set up PHP
+      uses: shivammathur/setup-php@v2
+      with:
+        php-version: ${{ matrix.php }}
+    - uses: actions/checkout@v2
+    - run: echo "::add-matcher::.github/php-syntax.json"
+    - name: Remove files to be ignored
+      run: |
+        true
+    - run: |
+        ! find . -type f -name '*.php' -exec php -l '{}' \; 2>&1 |grep -v '^No syntax errors detected'