-
Notifications
You must be signed in to change notification settings - Fork 13
49 lines (45 loc) · 1.21 KB
/
Copy pathbuild-web.yml
File metadata and controls
49 lines (45 loc) · 1.21 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
name: Build Web
on:
workflow_call:
defaults:
run:
shell: bash
env:
PUB_ENVIRONMENT: bot.github
jobs:
build-web:
name: Build web flutter app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Setup Flutter SDK
uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION }}
channel: stable
cache: true
- name: Install example dependencies
working-directory: example
run: flutter pub get
- name: Test example
working-directory: example
run: flutter test
- name: Build example web
working-directory: example
run: flutter build web
- name: Check if example web exists
working-directory: example
run: |
set -e
if [ ! -f build/web/flutter.js ]; then
echo "Web build not found!"
exit 1
fi
- name: Cleanup
if: ${{ always() }}
working-directory: example
run: |
rm -rf build
if command -v flutter &>/dev/null; then
flutter clean
fi