-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (51 loc) · 1.89 KB
/
build.yml
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
# Note: In a yml each level is padded by 2 spaces
name: Flutter
on:
# Runs this action when you push on master
push:
branches: [ "master" ]
# Runs this when a PR against master is created
pull_request:
branches: [ "master" ]
jobs:
flutter_job:
# The machine, we can also use windows-latest or ubuntu-latest
# We are choosing macos-latest because we will be also building for iOS
runs-on: macos-latest
steps:
# Clones the project on the machine
- uses: actions/checkout@v4
# Sets up java 11
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
# Installs flutter and related dependency on this machine
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
# flutter-version: '3.16.8'
# ^ If you want to use a specific version of flutter
# Fetches proj dependencies from pub
- name: Install dependencies
run: flutter pub get
# ^ If you want to use a specific version of flutter
# Verifies if the dart code is formatted well
- name: Verify formatting
run: dart format --output=none --set-exit-if-changed .
# --set-exit-if-changed stops execution if the any code is not well formatted
# --output=none prints files which needs to be formatted
# Checks for Symantic errors. Can be configured using analysis_options.yaml
- name: Analyze project source
run: flutter analyze --fatal-warnings
# optionally use --fatal-warnings to stop execution if any warnings are found
# Runs unit test
- name: Run tests
run: flutter test
# Create android apk
- name: Build apk
run: flutter build apk
# Create ios ipa
- name: Build ipa
run: flutter build ipa --no-codesign