Browse Source

Add QML label check to CI

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
Claudio Cambra 3 years ago
parent
commit
2e3768278d
1 changed files with 24 additions and 0 deletions
  1. 24 0
      .github/workflows/qml-label-check.yml

+ 24 - 0
.github/workflows/qml-label-check.yml

@@ -0,0 +1,24 @@
+name: QML Label component check
+on:
+  push:
+    branches:
+      - master
+  pull_request:
+    types: [opened, synchronize, reopened]
+jobs:
+  build:
+    name: Build
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - name: Run label component count
+        run: |
+          MATCHESRESULT=$(grep -r -e "^\s*Label\s*[{]" . | wc -l | sed 's/ //g')
+          echo "MATCHES=${MATCHESRESULT}" >> $GITHUB_ENV
+          echo "EXPECTED_MATCHES=1" >> $GITHUB_ENV
+      - name: Check label component use count
+        if: env.MATCHES != env.EXPECTED_MATCHES
+        uses: actions/github-script@v3
+        with:
+          script: |
+              core.setFailed('Using QML Labels! Make sure to use EnforcedPlainTextLabel instead!')