Repository navigation
Expand file tree
/
Copy pathgoogle_api_availability_package.yaml
More file actions
75 lines (64 loc) · 2.08 KB
/
Copy pathgoogle_api_availability_package.yaml
File metadata and controls
75 lines (64 loc) · 2.08 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
name: Package - Continuous Integration
# Called from google_api_availability_ci.yaml, once for every package that needs
# checking: format, analyze, the unit tests where the package has them, and the
# example build.
on:
workflow_call:
inputs:
package:
description: The package directory, relative to the repository root.
type: string
required: true
runs-on:
description: The runner to use.
type: string
required: true
java:
description: Install JDK 17, which an Android example build needs.
type: boolean
default: false
unit-tests:
description: Run the unit tests with `flutter test`.
type: boolean
default: false
example-build:
description: Commands that build the example, run in `<package>/example`.
type: string
default: ""
jobs:
ci:
name: ${{ inputs.package }}
runs-on: ${{ inputs.runs-on }}
# Bash on every runner, so a multi-line example build stops at its first
# failing command. GitHub runs it as `bash -eo pipefail`.
defaults:
run:
shell: bash
working-directory: ${{ inputs.package }}
steps:
- uses: actions/checkout@v7
- name: Install JDK 17
if: inputs.java
uses: actions/setup-java@v6
with:
distribution: "temurin"
java-version: "17"
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Download dependencies
run: flutter pub get
- name: Run Dart Format
run: dart format --set-exit-if-changed .
- name: Run Flutter Analyzer
run: flutter analyze
- name: Run unit tests
if: inputs.unit-tests
run: flutter test
# The commands come from google_api_availability_ci.yaml, never from the
# event, so expanding them into the script is safe.
- name: Build example
if: inputs.example-build != ''
working-directory: ${{ inputs.package }}/example
run: ${{ inputs.example-build }}