Repository navigation
Expand file tree
/
Copy pathgoogle_api_availability_ci.yaml
More file actions
100 lines (92 loc) · 3.58 KB
/
Copy pathgoogle_api_availability_ci.yaml
File metadata and controls
100 lines (92 loc) · 3.58 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
name: Google API Availability - Continuous Integration
# Single entry point for CI. Every package is checked by the reusable
# google_api_availability_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 }}
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/google_api_availability_ci.yaml'
- '.github/workflows/google_api_availability_package.yaml'
platform_interface:
- *shared
- 'google_api_availability_platform_interface/**'
android:
- *shared
- 'google_api_availability_android/**'
app_facing:
- *shared
- 'google_api_availability/**'
platform_interface:
needs: changes
if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.platform_interface == 'true'
uses: ./.github/workflows/google_api_availability_package.yaml
with:
package: google_api_availability_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/google_api_availability_package.yaml
with:
package: google_api_availability_android
runs-on: ubuntu-latest
java: true
unit-tests: true
example-build: flutter build apk --release
# The plugin only supports Android, so the example is only built for Android.
app_facing:
needs: changes
if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.app_facing == 'true'
uses: ./.github/workflows/google_api_availability_package.yaml
with:
package: google_api_availability
runs-on: ubuntu-latest
java: true
unit-tests: true
example-build: flutter build apk --release
ci-result: # ← the only required check
needs: [changes, platform_interface, android, app_facing]
if: always()
runs-on: ubuntu-latest
steps:
- run: |
if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
exit 1
fi