Repository navigation
117 lines (108 loc) · 3.94 KB
/
Copy pathgeocoding_ci.yaml
File metadata and controls
117 lines (108 loc) · 3.94 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Geocoding - Continuous Integration
# Single entry point for CI. Every package is checked by the reusable
# geocoding_package.yaml, and only when that package changed. Make `ci-result`
# the only required status check: it reports on every run, also when the
# package jobs are skipped.
#
# Starting it by hand runs every package, for example to check main against a
# new Flutter stable release.
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
# A new push to a pull request cancels the run for the previous one. Every other
# run gets a group of its own and is never cancelled, so every merged commit and
# every manual run gets a result.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
# The called workflow inherits these and can only narrow them. paths-filter
# reads the changed files of a pull request through the API.
permissions:
contents: read
pull-requests: read
jobs:
changes:
runs-on: ubuntu-latest
outputs:
android: ${{ steps.filter.outputs.android }}
darwin: ${{ steps.filter.outputs.darwin }}
platform_interface: ${{ steps.filter.outputs.platform_interface }}
app_facing: ${{ steps.filter.outputs.app_facing }}
steps:
- uses: actions/checkout@v7
- uses: dorny/paths-filter@v4
id: filter
if: github.event_name != 'workflow_dispatch'
with:
# The packages are not a pub workspace: each one resolves its
# siblings from pub.dev, so a package only needs checking when its
# own sources or the CI configuration changed.
filters: |
shared: &shared
- '.github/workflows/geocoding_ci.yaml'
- '.github/workflows/geocoding_package.yaml'
platform_interface:
- *shared
- 'geocoding_platform_interface/**'
android:
- *shared
- 'geocoding_android/**'
darwin:
- *shared
- 'geocoding_darwin/**'
app_facing:
- *shared
- 'geocoding/**'
platform_interface:
needs: changes
if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.platform_interface == 'true'
uses: ./.github/workflows/geocoding_package.yaml
with:
package: geocoding_platform_interface
runs-on: ubuntu-latest
unit-tests: true
android:
needs: changes
if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.android == 'true'
uses: ./.github/workflows/geocoding_package.yaml
with:
package: geocoding_android
runs-on: ubuntu-latest
java: true
example-build: flutter build apk --release
# geocoding_darwin is the iOS and macOS implementation, so the example is
# built for both.
darwin:
needs: changes
if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.darwin == 'true'
uses: ./.github/workflows/geocoding_package.yaml
with:
package: geocoding_darwin
runs-on: macos-latest
example-build: |
flutter build ios --no-codesign --release
flutter build macos --release
app_facing:
needs: changes
if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.app_facing == 'true'
uses: ./.github/workflows/geocoding_package.yaml
with:
package: geocoding
runs-on: macos-latest
java: true
unit-tests: true
example-build: |
flutter build apk --release
flutter build ios --release --no-codesign
ci-result: # ← the only required check
needs: [changes, platform_interface, android, darwin, app_facing]
if: always()
runs-on: ubuntu-latest
steps:
- run: |
if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
exit 1
fi