3434 with :
3535 fail-on-severity : high
3636 deny-licenses : GPL-3.0-only,GPL-3.0-or-later,AGPL-3.0-only,AGPL-3.0-or-later
37+ # No patched release exists for either advisory, and both are reached only through nuxt's
38+ # build and dev tooling in quickstarts/nuxt, which ignores them for `pnpm audit` too (see its
39+ # pnpm-workspace.yaml for the full justification). Drop each once upstream ships a fix.
40+ # GHSA-vfj7-8cjw-p6xm: braces stack-exhaustion DoS on the project's own glob patterns.
41+ # GHSA-86w9-cpqp-85rv: node-forge signature verification; only used for local dev certs.
42+ allow-ghsas : GHSA-vfj7-8cjw-p6xm, GHSA-86w9-cpqp-85rv
43+ # ThunderID's own Apache-2.0 package, which the dependency graph reports with the non-SPDX
44+ # lowercase id `apache-2.0`, failing the license validity check.
45+ allow-dependencies-licenses : pkg:pub/thunderid_flutter
3746 comment-summary-in-pr : always
3847 base-ref : ${{ github.event.pull_request.base.sha }}
3948 head-ref : ${{ github.event.pull_request.head.sha }}
@@ -43,30 +52,40 @@ jobs:
4352 runs-on : ubuntu-latest
4453 timeout-minutes : 5
4554 outputs :
46- samples : ${{ steps.find.outputs.samples }}
55+ node : ${{ steps.find.outputs.node }}
56+ flutter : ${{ steps.find.outputs.flutter }}
57+ android : ${{ steps.find.outputs.android }}
58+ ios : ${{ steps.find.outputs.ios }}
4759 steps :
4860 - name : 📥 Checkout Code
4961 uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
5062
51- # Every <category>/<sample>/ directory at the repo root with a package.json is a sample.
63+ # Every <category>/<sample>/ directory at the repo root is a sample. Its stack is picked from
64+ # the manifest at its root: package.json (Node.js), pubspec.yaml (Flutter),
65+ # settings.gradle.kts (Android) or Package.swift (iOS).
5266 - name : 🔍 Find Samples
5367 id : find
5468 run : |
55- samples=$(find . -mindepth 3 -maxdepth 3 -name package.json -not -path "./.*" -not -path "*/node_modules/*" \
56- -exec dirname {} \; 2>/dev/null | sed 's#^\./##' | sort | jq -R . | jq -cs .)
57- echo "samples=$samples" >> "$GITHUB_OUTPUT"
58- echo "Samples: $samples"
69+ find_samples() {
70+ find . -mindepth 3 -maxdepth 3 -name "$1" -not -path "./.*" -not -path "*/node_modules/*" \
71+ -exec dirname {} \; 2>/dev/null | sed 's#^\./##' | sort | jq -R . | jq -cs .
72+ }
73+ for stack in node:package.json flutter:pubspec.yaml android:settings.gradle.kts ios:Package.swift; do
74+ samples=$(find_samples "${stack#*:}")
75+ echo "${stack%%:*}=$samples" >> "$GITHUB_OUTPUT"
76+ echo "${stack%%:*} samples: $samples"
77+ done
5978
6079 build-lint :
6180 name : 🔨 Build & Lint (${{ matrix.sample }})
6281 needs : discover
63- if : ${{ needs.discover.outputs.samples != '[]' }}
82+ if : ${{ needs.discover.outputs.node != '[]' }}
6483 runs-on : ubuntu-latest
6584 timeout-minutes : 15
6685 strategy :
6786 fail-fast : false
6887 matrix :
69- sample : ${{ fromJson(needs.discover.outputs.samples ) }}
88+ sample : ${{ fromJson(needs.discover.outputs.node ) }}
7089 defaults :
7190 run :
7291 working-directory : ${{ matrix.sample }}
@@ -99,11 +118,119 @@ jobs:
99118 - name : 🔍 Security Audit
100119 run : pnpm audit --audit-level=high
101120
121+ # Not every sample has a formatter, a linter or a build step (e.g. the Node.js
122+ # server quickstarts run their sources directly), so each runs only where defined.
102123 - name : 🎨 Check Formatting
103- run : pnpm format:check
124+ run : pnpm run --if-present format:check
104125
105126 - name : 🧹 Lint
106- run : pnpm lint
127+ run : pnpm run --if-present lint
107128
108129 - name : 🔨 Build
109- run : pnpm build
130+ run : pnpm run --if-present build
131+
132+ build-flutter :
133+ name : 🦋 Analyze & Build (${{ matrix.sample }})
134+ needs : discover
135+ if : ${{ needs.discover.outputs.flutter != '[]' }}
136+ runs-on : ubuntu-latest
137+ timeout-minutes : 30
138+ strategy :
139+ fail-fast : false
140+ matrix :
141+ sample : ${{ fromJson(needs.discover.outputs.flutter) }}
142+ defaults :
143+ run :
144+ working-directory : ${{ matrix.sample }}
145+ steps :
146+ - name : 📥 Checkout Code
147+ uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
148+
149+ - name : ☕ Set up JDK
150+ uses : actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4
151+ with :
152+ distribution : ' temurin'
153+ java-version : ' 17'
154+
155+ - name : 🐦 Set up Flutter
156+ uses : subosito/flutter-action@4cab68ce0f1c7c924f688bff4792e044f1aeb30c # v2
157+ with :
158+ channel : stable
159+ cache : true
160+
161+ # Samples that bundle a .env as an asset need the file present to build.
162+ - name : 🔐 Create .env
163+ run : if [ -f .env.example ] && [ ! -f .env ]; then cp .env.example .env; fi
164+
165+ - name : 📦 Get Dependencies
166+ run : flutter pub get
167+
168+ - name : 🔍 Analyze
169+ run : flutter analyze
170+
171+ - name : 🔨 Build Android APK
172+ run : flutter build apk --debug
173+
174+ build-android :
175+ name : 🤖 Build (${{ matrix.sample }})
176+ needs : discover
177+ if : ${{ needs.discover.outputs.android != '[]' }}
178+ runs-on : ubuntu-latest
179+ timeout-minutes : 30
180+ strategy :
181+ fail-fast : false
182+ matrix :
183+ sample : ${{ fromJson(needs.discover.outputs.android) }}
184+ defaults :
185+ run :
186+ working-directory : ${{ matrix.sample }}
187+ steps :
188+ - name : 📥 Checkout Code
189+ uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
190+
191+ - name : ☕ Set up JDK
192+ uses : actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4
193+ with :
194+ distribution : ' temurin'
195+ java-version : ' 17'
196+
197+ - name : 🗄️ Cache Gradle
198+ uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
199+ with :
200+ path : |
201+ ~/.gradle/caches
202+ ~/.gradle/wrapper
203+ key : ${{ runner.os }}-gradle-${{ matrix.sample }}-${{ hashFiles(format('{0}/**/*.gradle.kts', matrix.sample), format('{0}/**/gradle-wrapper.properties', matrix.sample)) }}
204+ restore-keys : |
205+ ${{ runner.os }}-gradle-${{ matrix.sample }}-
206+
207+ - name : 🔨 Build Debug APK
208+ run : ./gradlew assembleDebug
209+
210+ build-ios :
211+ name : 🍎 Build (${{ matrix.sample }})
212+ needs : discover
213+ if : ${{ needs.discover.outputs.ios != '[]' }}
214+ runs-on : macos-latest
215+ timeout-minutes : 30
216+ strategy :
217+ fail-fast : false
218+ matrix :
219+ sample : ${{ fromJson(needs.discover.outputs.ios) }}
220+ defaults :
221+ run :
222+ working-directory : ${{ matrix.sample }}
223+ steps :
224+ - name : 📥 Checkout Code
225+ uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
226+
227+ - name : 🗄️ Cache Swift Packages
228+ uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
229+ with :
230+ path : ${{ matrix.sample }}/.build
231+ key : ${{ runner.os }}-swift-${{ matrix.sample }}-${{ hashFiles(format('{0}/Package.resolved', matrix.sample)) }}
232+ restore-keys : |
233+ ${{ runner.os }}-swift-${{ matrix.sample }}-
234+
235+ - name : 🔨 Build
236+ run : swift build
0 commit comments