|
1 | | -name: Build and Test |
| 1 | +name: Pull Request |
| 2 | + |
2 | 3 | on: |
3 | | - push: |
4 | 4 | pull_request: |
5 | | -defaults: |
6 | | - run: |
7 | | - shell: bash |
8 | | -env: |
9 | | - PUB_ENVIRONMENT: bot.github |
10 | | - # pinned to latest stable version |
11 | | - FLUTTER_SDK_VERSION: 3.19.3 |
| 5 | + |
| 6 | +concurrency: |
| 7 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 8 | + cancel-in-progress: true |
12 | 9 |
|
13 | 10 | jobs: |
14 | 11 | test: |
15 | | - name: Test |
16 | | - runs-on: ubuntu-latest |
17 | | - steps: |
18 | | - - uses: actions/checkout@v4 |
19 | | - - name: Setup Flutter SDK |
20 | | - uses: subosito/flutter-action@v2 |
21 | | - with: |
22 | | - flutter-version: ${{ env.FLUTTER_SDK_VERSION }} |
23 | | - channel: "stable" |
24 | | - cache: true |
25 | | - - name: Install dependencies |
26 | | - run: flutter pub get |
27 | | - - name: Run tests |
28 | | - run: flutter test |
29 | | - - name: Cleanup |
30 | | - if: ${{ always() }} |
31 | | - run: | |
32 | | - if command -v flutter &>/dev/null; then |
33 | | - flutter clean |
34 | | - fi |
| 12 | + uses: ./.github/workflows/test.yml |
| 13 | + |
35 | 14 | build-android: |
36 | 15 | needs: test |
37 | | - name: Build Android flutter app |
38 | | - runs-on: ubuntu-latest |
39 | | - steps: |
40 | | - - uses: actions/checkout@v4 |
41 | | - - uses: actions/setup-java@v4 |
42 | | - with: |
43 | | - distribution: "temurin" |
44 | | - java-version: "17" |
45 | | - cache: "gradle" |
46 | | - - name: Setup Flutter SDK |
47 | | - uses: subosito/flutter-action@v2 |
48 | | - with: |
49 | | - flutter-version: ${{ env.FLUTTER_SDK_VERSION }} |
50 | | - channel: "stable" |
51 | | - cache: true |
52 | | - - name: Install example dependencies |
53 | | - working-directory: example |
54 | | - run: flutter pub get |
55 | | - - name: Test example |
56 | | - working-directory: example |
57 | | - run: flutter test |
58 | | - - name: Build example APK |
59 | | - working-directory: example |
60 | | - run: flutter build apk |
61 | | - - name: Check if example APK exists |
62 | | - working-directory: example |
63 | | - run: | |
64 | | - set -e |
65 | | - if [ ! -f build/app/outputs/apk/release/app-release.apk ]; then |
66 | | - echo "APK file not found!" |
67 | | - exit 1 |
68 | | - fi |
69 | | - - name: Build example App Bundle |
70 | | - working-directory: example |
71 | | - run: flutter build appbundle |
72 | | - - name: Check if example App Bundle exists |
73 | | - working-directory: example |
74 | | - run: | |
75 | | - set -e |
76 | | - if [ ! -f build/app/outputs/bundle/release/app-release.aab ]; then |
77 | | - echo "App Bundle not found!" |
78 | | - exit 1 |
79 | | - fi |
80 | | - - name: Cleanup |
81 | | - if: ${{ always() }} |
82 | | - working-directory: example |
83 | | - run: | |
84 | | - rm -rf build |
85 | | - if command -v flutter &>/dev/null; then |
86 | | - flutter clean |
87 | | - fi |
| 16 | + uses: ./.github/workflows/build-android.yml |
| 17 | + |
88 | 18 | build-ios: |
89 | 19 | needs: test |
90 | | - name: Build iOS flutter app |
91 | | - runs-on: macos-15 |
92 | | - steps: |
93 | | - - uses: actions/checkout@v4 |
94 | | - - name: Set up Xcode 16 |
95 | | - uses: maxim-lobanov/setup-xcode@v1 |
96 | | - with: |
97 | | - xcode-version: 16.3.0 |
98 | | - - name: Setup Flutter SDK |
99 | | - uses: subosito/flutter-action@v2 |
100 | | - with: |
101 | | - flutter-version: ${{ env.FLUTTER_SDK_VERSION }} |
102 | | - channel: "stable" |
103 | | - cache: true |
104 | | - - name: Install example dependencies |
105 | | - working-directory: example |
106 | | - run: flutter pub get |
107 | | - - name: Test |
108 | | - working-directory: example |
109 | | - run: flutter test |
110 | | - - name: Build unsigned example Xcode archive |
111 | | - working-directory: example |
112 | | - run: flutter build ipa --no-codesign |
113 | | - - name: Check if unsigned example Xcode archive exists |
114 | | - working-directory: example |
115 | | - run: | |
116 | | - set -e |
117 | | - if [ ! -d build/ios/archive/Runner.xcarchive ]; then |
118 | | - echo "Xcode archive not found!" |
119 | | - exit 1 |
120 | | - fi |
121 | | - - name: Cleanup |
122 | | - if: ${{ always() }} |
123 | | - working-directory: example |
124 | | - run: | |
125 | | - rm -rf build |
126 | | - if command -v flutter &>/dev/null; then |
127 | | - flutter clean |
128 | | - fi |
| 20 | + uses: ./.github/workflows/build-ios.yml |
| 21 | + |
129 | 22 | build-web: |
130 | 23 | needs: test |
131 | | - name: Build web flutter app |
132 | | - runs-on: ubuntu-latest |
133 | | - steps: |
134 | | - - uses: actions/checkout@v4 |
135 | | - - name: Setup Flutter SDK |
136 | | - uses: subosito/flutter-action@v2 |
137 | | - with: |
138 | | - flutter-version: ${{ env.FLUTTER_SDK_VERSION }} |
139 | | - channel: "stable" |
140 | | - cache: true |
141 | | - - name: Install example dependencies |
142 | | - working-directory: example |
143 | | - run: flutter pub get |
144 | | - - name: Test example |
145 | | - working-directory: example |
146 | | - run: flutter test |
147 | | - - name: Build example web |
148 | | - working-directory: example |
149 | | - run: flutter build web |
150 | | - - name: Check if example web exists |
151 | | - working-directory: example |
152 | | - run: | |
153 | | - set -e |
154 | | - if [ ! -f build/web/flutter.js ]; then |
155 | | - echo "Web build not found!" |
156 | | - exit 1 |
157 | | - fi |
158 | | - - name: Cleanup |
159 | | - if: ${{ always() }} |
160 | | - working-directory: example |
161 | | - run: | |
162 | | - rm -rf build |
163 | | - if command -v flutter &>/dev/null; then |
164 | | - flutter clean |
165 | | - fi |
| 24 | + uses: ./.github/workflows/build-web.yml |
0 commit comments