Skip to content

Commit c8a0f21

Browse files
huyenltnguyenSembaukeNirajn2311
authored
chore(ci): move analyze and unit tests to a separate workflow (#1568)
* chore(ci): move analyze and unit tests to a separate workflow * silly me * fix: name for e2e workflows * chore: upgrade flutter version --------- Co-authored-by: Sem Bauke <[email protected]> Co-authored-by: Niraj Nandish <[email protected]>
1 parent 888a549 commit c8a0f21

File tree

4 files changed

+59
-21
lines changed

4 files changed

+59
-21
lines changed

.github/workflows/flutter-ci.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Flutter CI
1+
name: Flutter Android
22

33
on:
44
pull_request:
@@ -15,7 +15,7 @@ on:
1515

1616
jobs:
1717
flutter_test:
18-
name: flutter test
18+
name: e2e Tests
1919
defaults:
2020
run:
2121
working-directory: ./mobile-app
@@ -100,15 +100,6 @@ jobs:
100100
- name: Install packages
101101
run: flutter pub get
102102

103-
- name: Analyze code
104-
run: flutter analyze
105-
106-
- name: Run unit tests
107-
run: |
108-
cd test
109-
flutter test unit
110-
flutter test services
111-
112103
- name: Run tests in emulator
113104
uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # v2
114105
with:

.github/workflows/flutter-deploy.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,6 @@ jobs:
9595
- name: Install packages
9696
run: flutter pub get
9797

98-
- name: Analyze code
99-
run: flutter analyze
100-
101-
- name: Run unit tests
102-
run: |
103-
cd test
104-
flutter test unit
105-
flutter test services
106-
10798
- name: Run tests in emulator
10899
uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # v2
109100
with:
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Flutter Unit Tests
2+
3+
on:
4+
pull_request:
5+
branches: [main, prod]
6+
paths:
7+
- "mobile-app/**"
8+
- ".github/**"
9+
push:
10+
branches: [main, prod]
11+
12+
jobs:
13+
unit-tests:
14+
name: Analyze and Run Unit Tests
15+
defaults:
16+
run:
17+
working-directory: ./mobile-app
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout files
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Flutter 3.32.x
24+
uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 # v2
25+
with:
26+
flutter-version: "3.32.x"
27+
channel: "stable"
28+
cache: true
29+
cache-key: flutter-3.32.x
30+
cache-path: ${{ runner.tool_cache }}/flutter
31+
32+
- name: Create .env file
33+
run: |
34+
echo "HASHNODE_PUBLICATION_ID=$HASHNODE_PUBLICATION_ID" > .env
35+
echo "ALGOLIAAPPID=$ALGOLIA_APP_ID" >> .env
36+
echo "ALGOLIAKEY=$ALGOLIA_KEY" >> .env
37+
echo "AUTH0_DOMAIN=$AUTH0_DOMAIN" >> .env
38+
echo "AUTH0_CLIENT_ID=$AUTH0_CLIENT_ID" >> .env
39+
env:
40+
HASHNODE_PUBLICATION_ID: ${{ secrets.HASHNODE_PUBLICATION_ID }}
41+
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
42+
ALGOLIA_KEY: ${{ secrets.ALGOLIA_KEY }}
43+
AUTH0_DOMAIN: ${{ secrets.AUTH0_DOMAIN }}
44+
AUTH0_CLIENT_ID: ${{ secrets.AUTH0_CLIENT_ID }}
45+
46+
- name: Install packages
47+
run: flutter pub get
48+
49+
- name: Analyze code
50+
run: flutter analyze
51+
52+
- name: Run unit tests
53+
run: |
54+
cd test
55+
flutter test unit
56+
flutter test services

codemagic.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
workflows:
22
flutter-ios-ci:
3-
name: Flutter iOS CI
3+
name: Flutter iOS e2e Tests
44
instance_type: mac_mini_m2
55
max_build_duration: 30
66

0 commit comments

Comments
 (0)