generated from Flutter-Journey/Flutter-Clean-Template
-
Notifications
You must be signed in to change notification settings - Fork 28
100 lines (96 loc) · 3.34 KB
/
pr_check.yml
File metadata and controls
100 lines (96 loc) · 3.34 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
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
# This is a basic workflow to help you get started with Actions
name: Cinema Booking - PR Check
# Controls when the workflow will run
on:
pull_request_target:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
validation:
name: 'Run test and build android and web code'
runs-on: ubuntu-latest
concurrency:
cancel-in-progress: true
group: ${{ github.event.pull_request.number || github.event.pull_request_target.number || github.ref }}
steps:
- name: checkout source code
uses: actions/checkout@v4.1.7
with:
ref: ${{ github.event.pull_request_target.head.ref || github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request_target.head.repo.full_name || github.event.pull_request.head.repo.full_name}}
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'
- name: setup secrets
run: |
echo "$FIREBASE_OPTION" > lib/firebase_options.dart
echo "$ANDROID_GOOGLE_SERVICE" > android/app/google-services.json
env:
FIREBASE_OPTION: ${{ secrets.FIREBASE_OPTIONS }}
ANDROID_GOOGLE_SERVICE: ${{ secrets.ANDROID_GOOGLE_SERVICE }}
- name: Flutter action
uses: subosito/flutter-action@v2.16.0
with:
flutter-version: '3.29.0'
channel: 'stable'
- name: Flutter doctor
run: flutter doctor
- name: Format code
run: |
dart format lib/*/ --set-exit-if-changed
dart format lib/main.dart --set-exit-if-changed
dart format test --set-exit-if-changed
- name: analyse code
run: |
flutter pub get
dart analyze --fatal-infos --fatal-warnings
- name: Run tests
run: |
flutter test --coverage
- name: build apk
run: flutter build apk --debug
- name: build web
run: flutter build web
# ios_validation:
# name: 'iOS validation'
# runs-on: macos-14
# concurrency:
# cancel-in-progress: true
# group: ${{ github.event.pull_request.number || github.event.pull_request_target.number || github.ref }}
# needs: validation
# steps:
# - name: Checkout
# uses: actions/checkout@v4.1.7
# with:
# ref: ${{ github.event.sha }}
# repository: ${{ github.event.pull_request_target.head.repo.full_name || github.event.pull_request.head.repo.full_name}}
# fetch-depth: 0
# - name: setup secrets
# run: |
# echo "$FIREBASE_OPTION" > lib/firebase_options.dart
# echo "$IOS_GOOGLE_SERVICE" > ios/Runner/GoogleService-Info.plist
# env:
# FIREBASE_OPTION: ${{ secrets.FIREBASE_OPTIONS }}
# IOS_GOOGLE_SERVICE: ${{ secrets.IOS_GOOGLE_SERVICE }}
# - name: Install Flutter
# uses: subosito/flutter-action@v2.16.0
# with:
# flutter-version: '3.29.0'
# channel: 'stable'
# - name: setup XCode
# uses: maxim-lobanov/setup-xcode@v1.6.0
# with:
# xcode-version: 15.4
# - name: setup Cocoapod
# uses: maxim-lobanov/setup-cocoapods@v1.4.0
# with:
# version: 1.13.0
# - name: build iOS no codesign
# run: |
# flutter pub get
# flutter build ipa --no-codesign