Просмотр исходного кода

ci: run example config check in ci

Zaiming (Stone) Shi 2 лет назад
Родитель
Сommit
41de679557

+ 24 - 0
.github/workflows/run_test_cases.yaml

@@ -88,6 +88,30 @@ jobs:
           name: source-${{ matrix.profile }}-${{ matrix.otp }}
           path: source.zip
 
+  check_examples:
+    needs:
+      - build-matrix
+      - prepare
+    runs-on: ${{ needs.build-matrix.outputs.runs-on }}
+    strategy:
+      fail-fast: false
+      matrix:
+        include: ${{ fromJson(needs.build-matrix.outputs.prepare) }}
+    container: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-ubuntu22.04"
+    steps:
+      - uses: AutoModality/action-clean@v1
+      - uses: actions/download-artifact@v3
+        with:
+          name: source-${{ matrix.profile }}-${{ matrix.otp }}
+          path: .
+      - name: unzip source code
+        run: unzip -o -q source.zip
+      - name: check example config files
+        env:
+          PROFILE: ${{ matrix.profile }}
+        working-directory: source
+        run: ./scripts/test/check-example-configs.sh
+
   static_checks:
     needs:
       - build-matrix

+ 1 - 1
apps/emqx_prometheus/src/emqx_prometheus.app.src

@@ -2,7 +2,7 @@
 {application, emqx_prometheus, [
     {description, "Prometheus for EMQX"},
     % strict semver, bump manually!
-    {vsn, "5.0.12"},
+    {vsn, "5.0.13"},
     {modules, []},
     {registered, [emqx_prometheus_sup]},
     {applications, [kernel, stdlib, prometheus, emqx, emqx_management]},

+ 1 - 2
scripts/test/check-example-configs.sh

@@ -9,7 +9,6 @@ SCHEMA_MOD='emqx_conf_schema'
 if [ "${PROFILE}" = 'emqx-enterprise' ]; then
     DIR_NAME='ee-examples'
     SCHEMA_MOD='emqx_enterprise_schema'
-    PA=""
 fi
 
 IFS=$'\n' read -r -d '' -a FILES < <(find "${PROJ_DIR}/rel/config/${DIR_NAME}" -name "*.example" 2>/dev/null | sort && printf '\0')
@@ -49,6 +48,6 @@ check_file() {
         end."
 }
 
-for file in ${FILES[@]}; do
+for file in "${FILES[@]}"; do
     check_file "$file"
 done