This repository has been archived by the owner on Jun 9, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 261
102 lines (90 loc) · 2.95 KB
/
flutter-ci.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
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
101
name: Flutter CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- uses: subosito/flutter-action@v1
with:
flutter-version: '2.5.3'
- uses: dart-lang/setup-dart@v1
with:
sdk: '2.14.4'
- name: Cache Gradle modules
uses: actions/[email protected]
env:
cache-number: ${{ secrets.CACHE_NUMBER }}
with:
path: |
~/android/.gradle
~/.gradle/cache
# ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ env.cache-number }}-${{ hashFiles('android/build.gradle') }}-${{ hashFiles('android/app/build.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-${{ env.cache-name }}-${{ hashFiles('android/build.gradle') }}
${{ runner.os }}-gradle-${{ env.cache-name }}-
${{ runner.os }}-gradle-
${{ runner.os }}-
- name: Cache CocoaPods modules
uses: actions/[email protected]
env:
cache-number: ${{ secrets.CACHE_NUMBER }}
with:
path: Pods
key: ${{ runner.os }}-pods-${{ env.cache-number }}-${{ hashFiles('ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-${{ env.cache-name }}-
${{ runner.os }}-pods-
${{ runner.os }}-
- name: Cache Flutter modules
uses: actions/[email protected]
env:
cache-number: ${{ secrets.CACHE_NUMBER }}
with:
path: |
~/.pub-cache/bin
key: ${{ runner.os }}-pub-${{ env.cache-number }}-${{ env.flutter_version }}-${{ hashFiles('pubspec.lock') }}
restore-keys: |
${{ runner.os }}-pub-${{ env.flutter_version }}-
${{ runner.os }}-pub-
${{ runner.os }}-
- name: Get flutter dependencies.
run: |
make setup
export PATH="$PATH":"$HOME/.pub-cache/bin"
make dependencies
- name: Check for any formatting and statically analyze the code.
run: make format-analyze
- name: Run widget tests for our flutter project.
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
make unit-test
make codecov
- name: Build ipa and apk
run: |
make build-android-prd
make build-ios-prd
- name: Slack Notification
uses: homoluctus/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: '*Flutter Build*'
mention: 'here'
mention_if: 'failure'
channel: '#develop'
username: 'Github Actions'
icon_emoji: ':octocat:'
url: ${{ secrets.SLACK_WEBHOOK_URL }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}