@@ -28,23 +28,10 @@ jobs:
2828 if : ${{ needs.pre_job.outputs.should_skip != 'true' }}
2929 runs-on : ubuntu-latest
3030 outputs :
31- payments : ${{ steps.filter.outputs.payments }}
32- user : ${{ steps.filter.outputs.user }}
33- chat : ${{ steps.filter.outputs.chat }}
34- common-styling : ${{ steps.filter.outputs.common-styling }}
35- tests : ${{ steps.filter.outputs.tests }}
36- core : ${{ steps.filter.outputs.core }}
37- oauth-facebook : ${{ steps.filter.outputs.oauth-facebook }}
38- oauth-github : ${{ steps.filter.outputs.oauth-github }}
39- oauth-google : ${{ steps.filter.outputs.oauth-google }}
40- openai : ${{ steps.filter.outputs.openai }}
41- reports : ${{ steps.filter.outputs.reports }}
42- data-export-api : ${{ steps.filter.outputs.data-export-api }}
43- payments-stripe : ${{ steps.filter.outputs.payments-stripe }}
44- payments-example-gateway : ${{ steps.filter.outputs.payments-example-gateway }}
31+ changed-modules : ${{ steps.set-matrix.outputs.matrix }}
4532 steps :
4633 - uses : actions/checkout@v4
47-
34+
4835 - uses : dorny/paths-filter@v3
4936 id : filter
5037 with :
@@ -78,55 +65,38 @@ jobs:
7865 payments-example-gateway:
7966 - 'pos-module-payments-example-gateway/**'
8067
68+ - name : Set matrix for changed modules
69+ id : set-matrix
70+ run : |
71+ # Extract module names where filter output is "true"
72+ modules=$(echo '${{ toJSON(steps.filter.outputs) }}' | jq -c '[to_entries[] | select(.value == "true") | .key]')
73+
74+ echo "matrix=$modules" >> $GITHUB_OUTPUT
75+ echo "Changed modules for linting: $modules"
76+
8177 lint-platformos-check :
8278 needs : detect-changes
79+ if : needs.detect-changes.outputs.changed-modules != '[]'
8380 runs-on : ubuntu-latest
8481 strategy :
8582 matrix :
86- module :
87- - payments
88- - user
89- - chat
90- - common-styling
91- - tests
92- - core
93- - oauth-facebook
94- - oauth-github
95- - oauth-google
96- - openai
97- - reports
98- - data-export-api
99- - payments-stripe
100- - payments-example-gateway
83+ module : ${{ fromJSON(needs.detect-changes.outputs.changed-modules) }}
10184 fail-fast : false
10285 env :
10386 CI : true
10487 PLATFORMOS_CHECK_DEBUG : true
10588 DOCKER_WORKSPACE : ${{ github.workspace }}/pos-module-${{ matrix.module }}
10689 LOGS_DIR : ${{ github.workspace }}/pos-module-${{ matrix.module }}/logs
10790 steps :
108- - name : Check if this module changed
109- id : changed
110- run : |
111- MODULE_CHANGED="${{ needs.detect-changes.outputs[matrix.module] }}"
112- if [ "$MODULE_CHANGED" != "true" ]; then
113- echo "skip=true" >> $GITHUB_OUTPUT
114- else
115- echo "skip=false" >> $GITHUB_OUTPUT
116- fi
117-
11891 - name : Checkout code
119- if : steps.changed.outputs.skip != 'true'
12092 uses : actions/checkout@v4
12193
12294 - name : Set up logs directory
123- if : steps.changed.outputs.skip != 'true'
12495 run : |
12596 mkdir -p ${{ env.LOGS_DIR }}
12697 chmod -R 777 ${{ env.LOGS_DIR }}
12798
12899 - name : Start PlatformOS LSP
129- if : steps.changed.outputs.skip != 'true'
130100 id : start_lsp
131101 run : |
132102 docker run -i \
@@ -137,7 +107,7 @@ jobs:
137107 platformos/platformos-lsp:latest
138108
139109 - name : Run platformos-check
140- if : steps.changed.outputs.skip != 'true' && steps. start_lsp.outcome == 'success'
110+ if : steps.start_lsp.outcome == 'success'
141111 id : run_check
142112 run : |
143113 set +e # Disable exit on error
@@ -155,7 +125,7 @@ jobs:
155125 exit $docker_exit_code
156126
157127 - name : Upload logs
158- if : always() && steps.changed.outputs.skip != 'true' && steps. run_check.outcome != 'skipped'
128+ if : always() && steps.run_check.outcome != 'skipped'
159129 uses : actions/upload-artifact@v4
160130 with :
161131 name : platformos_check_logs_${{ matrix.module }}_${{ github.run_id }}
@@ -165,7 +135,7 @@ jobs:
165135 ${{ env.LOGS_DIR }}/platformos-check-raw.json
166136
167137 - name : Generate summary
168- if : always() && steps.changed.outputs.skip != 'true' && steps. run_check.outcome != 'skipped'
138+ if : always() && steps.run_check.outcome != 'skipped'
169139 run : |
170140 echo "# PlatformOS Check Summary - ${{ matrix.module }} :checkered_flag:" >> $GITHUB_STEP_SUMMARY
171141 echo "## Result: ${{ steps.run_check.outcome }} ${{ env.RESULT_ICON }}" >> $GITHUB_STEP_SUMMARY
@@ -183,7 +153,7 @@ jobs:
183153 RESULT_ICON : ${{ steps.run_check.outcome == 'success' && ':white_check_mark:' || ':x:' }}
184154
185155 - name : Fail job if platformos-check failed
186- if : always() && steps.changed.outputs.skip != 'true' && steps. run_check.outcome == 'failure'
156+ if : always() && steps.run_check.outcome == 'failure'
187157 run : |
188158 echo "platformos-check failed — marking job as failed"
189159 exit 1
0 commit comments