Skip to content

Commit 0345409

Browse files
committed
Improved build script
1 parent 2f2b76b commit 0345409

File tree

12 files changed

+115
-465
lines changed

12 files changed

+115
-465
lines changed

.github/workflows/app_facing_package.yaml

Lines changed: 0 additions & 175 deletions
This file was deleted.

.github/workflows/geocoding.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: geocoding
4+
5+
# Controls when the action will run. Triggers the workflow on push or pull request
6+
# events but only for the master branch
7+
on:
8+
push:
9+
branches: [ master ]
10+
paths:
11+
- 'geocoding/**'
12+
pull_request:
13+
branches: [ master ]
14+
paths:
15+
- 'geocoding/**'
16+
17+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
18+
jobs:
19+
format:
20+
name: App Facing package
21+
22+
# The type of runner that the job will run on
23+
runs-on: macos-latest
24+
25+
env:
26+
source-directory: ./geocoding
27+
example-directory: ./geocoding/example
28+
29+
# Steps represent a sequence of tasks that will be executed as part of the job
30+
steps:
31+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
32+
- uses: actions/checkout@v3
33+
34+
# Make sure the stable version of Flutter is available
35+
- uses: subosito/flutter-action@v2
36+
with:
37+
channel: 'stable'
38+
39+
# Download all Flutter packages
40+
- name: Download dependencies
41+
run: flutter pub get
42+
working-directory: ${{env.source-directory}}
43+
44+
# Run Flutter Format to ensure formatting is valid
45+
- name: Run Flutter Format
46+
run: flutter format --set-exit-if-changed .
47+
working-directory: ${{env.source-directory}}
48+
49+
# Run Flutter Analyzer
50+
- name: Run Flutter Analyzer
51+
run: flutter analyze
52+
working-directory: ${{env.source-directory}}
53+
54+
# Build Android version of the example App
55+
- name: Run Android build
56+
run: flutter build apk --release
57+
working-directory: ${{env.example-directory}}
58+
59+
# Build iOS version of the example App
60+
- name: Run iOS build
61+
run: flutter build ios --release --no-codesign
62+
working-directory: ${{env.example-directory}}
63+
64+
# Run all unit-tests with code coverage
65+
- name: Run unit tests
66+
run: flutter test --coverage
67+
working-directory: ${{env.source-directory}}
68+
69+
# Upload code coverage information
70+
- uses: codecov/codecov-action@v1
71+
with:
72+
file: ${{env.source-directory}}/coverage/lcov.info # optional
73+
name: geocoding (App Facing Package) # optional
74+
fail_ci_if_error: true

.github/workflows/geocoding_android.yaml

Lines changed: 8 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,28 @@
33
name: geocoding_android
44

55
# Controls when the action will run. Triggers the workflow on push or pull request
6-
# events but only for the develop branch
6+
# events but only for the master branch
77
on:
88
push:
9-
branches: [ master, develop ]
9+
branches: [ master ]
1010
paths:
1111
- 'geocoding_android/**'
1212
pull_request:
13-
branches: [ master, develop ]
13+
branches: [ master ]
1414
paths:
1515
- 'geocoding_android/**'
1616

1717
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1818
jobs:
19-
format:
20-
name: Format
19+
build:
20+
name: Android platform package
2121

2222
# The type of runner that the job will run on
2323
runs-on: ubuntu-latest
2424

2525
env:
26-
source-directory: ./geocoding_android
26+
source-directory: ./geocoding_android
27+
example-directory: ./geocoding_android/example
2728

2829
# Steps represent a sequence of tasks that will be executed as part of the job
2930
steps:
@@ -44,102 +45,14 @@ jobs:
4445
- name: Run Flutter Format
4546
run: flutter format --set-exit-if-changed .
4647
working-directory: ${{env.source-directory}}
47-
48-
analyze:
49-
name: Analyze
50-
51-
# The type of runner that the job will run on
52-
runs-on: ubuntu-latest
5348

54-
env:
55-
source-directory: ./geocoding_android
56-
57-
# Steps represent a sequence of tasks that will be executed as part of the job
58-
steps:
59-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
60-
- uses: actions/checkout@v3
61-
62-
# Make sure the stable version of Flutter is available
63-
- uses: subosito/flutter-action@v2
64-
with:
65-
channel: 'stable'
66-
67-
# Download all Flutter packages
68-
- name: Download dependencies
69-
run: flutter pub get
70-
working-directory: ${{env.source-directory}}
71-
7249
# Run Flutter Analyzer
7350
- name: Run Flutter Analyzer
7451
run: flutter analyze
7552
working-directory: ${{env.source-directory}}
76-
77-
build_android:
78-
name: Build Android App
79-
80-
# The type of runner that the job will run on
81-
runs-on: ubuntu-latest
82-
83-
env:
84-
source-directory: ./geocoding_android
85-
example-directory: ./geocoding_android/example
86-
87-
# Steps represent a sequence of tasks that will be executed as part of the job
88-
steps:
89-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
90-
- uses: actions/checkout@v3
91-
92-
# Ensure correct JAVA version is installed.
93-
- uses: actions/setup-java@v1
94-
with:
95-
java-version: '12.x'
96-
97-
# Make sure the stable version of Flutter is available
98-
- uses: subosito/flutter-action@v2
99-
with:
100-
channel: 'stable'
101-
102-
# Download all Flutter packages
103-
- name: Download dependencies
104-
run: flutter pub get
105-
working-directory: ${{env.source-directory}}
10653

10754
# Build Android version of the example App
10855
- name: Run Android build
10956
run: flutter build apk --release
11057
working-directory: ${{env.example-directory}}
111-
112-
tests:
113-
name: Unit-tests
114-
# The type of runner that the job will run on
115-
runs-on: ubuntu-latest
116-
117-
env:
118-
source-directory: ./geocoding_android
119-
120-
# Steps represent a sequence of tasks that will be executed as part of the job
121-
steps:
122-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
123-
- uses: actions/checkout@v3
124-
125-
# Make sure the stable version of Flutter is available
126-
- uses: subosito/flutter-action@v2
127-
with:
128-
channel: 'stable'
129-
130-
# Download all Flutter packages
131-
- name: Download dependencies
132-
run: flutter pub get
133-
working-directory: ${{env.source-directory}}
134-
135-
# Run all unit-tests with code coverage
136-
- name: Run unit tests
137-
run: flutter test --coverage
138-
working-directory: ${{env.source-directory}}
139-
140-
# Upload code coverage information
141-
- uses: codecov/codecov-action@v1
142-
with:
143-
file: ${{env.source-directory}}/coverage/lcov.info # optional
144-
name: Geocoding Android # optional
145-
fail_ci_if_error: true
58+

0 commit comments

Comments
 (0)