-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (46 loc) · 1.45 KB
/
verify_packages.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: verify_packages
on:
push:
branches: [main]
paths:
- "packages/**"
pull_request:
branches: [main]
paths:
- "packages/**"
- ".github/workflows/verify_packages.yaml"
jobs:
detect-packages:
name: 🔍 Detect Changed Packages
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
packages: ${{ steps.set-packages.outputs.packages }}
steps:
- name: 📚 Git Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: 🔎 Find Changed Packages
id: set-packages
run: |
PACKAGES=$(git diff --name-only ${{ github.event.pull_request.base.sha || 'HEAD^' }} ${{ github.event.pull_request.head.sha || 'HEAD' }} -- 'packages/**' | \
grep -v '^packages/_\|\.yaml$' | \
cut -d'/' -f2 | \
sort -u | \
jq -R -s -c 'split("\n")[:-1]')
echo "Changed packages: $PACKAGES"
echo "packages=$PACKAGES" >> $GITHUB_OUTPUT
verify-packages:
name: 🛃 Verify ${{ matrix.package }}
needs: detect-packages
if: fromJson(needs.detect-packages.outputs.packages)[0] != null
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.detect-packages.outputs.packages) }}
uses: ./.github/workflows/verify_package_workflow.yaml
with:
package_name: ${{ matrix.package }}
is_flutter: ${{ contains(matrix.package, 'world_') }}
secrets: inherit