Skip to content

Commit 46b3662

Browse files
authored
ci: improve the workflows (#2443)
* ci: rework CI to build on all platforms, use flutter analyze commenter, omit emojis, separate main.yml into checks.yml and tests.yml * fix: replace universal_html with web for flutter_quill_extensions, minor changes to CI step names * chore(example): remove universal_html and universal_io transitive dependencies * ci: upload Android APK to GitHub releases
1 parent 606497d commit 46b3662

File tree

21 files changed

+451
-237
lines changed

21 files changed

+451
-237
lines changed

.github/workflows/build.yml

Lines changed: 83 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,107 @@
1-
# TODO: Update the workflow to build on Android, iOS, desktop (macOS and Windows) instead of just Linux and Web
2-
3-
name: 🏗️ Build the example
1+
name: Build the example
42

53
on:
64
pull_request:
75
branches: [master, dev]
86

97
jobs:
10-
build_linux:
11-
name: 🐧 Build Linux and Web Apps
8+
# Build the Linux, Android and web apps on Linux
9+
linux-web-android:
10+
name: Linux, Android and Web Apps
1211
runs-on: ubuntu-latest
1312

1413
steps:
15-
- name: 📦 Checkout repository
16-
uses: actions/checkout@v4
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Flutter
17+
uses: subosito/flutter-action@v2
18+
with:
19+
channel: stable
20+
cache: true
21+
22+
- name: Verify Flutter installation
23+
run: flutter --version
24+
25+
- name: Install flutter_quill dependencies
26+
run: flutter pub get
27+
28+
- name: Install example dependencies
29+
run: flutter pub get -C example
30+
31+
- name: Build the Web app
32+
run: flutter build web --release --dart-define=CI=true
33+
working-directory: ./example
34+
35+
- name: Build the Web app with WebAssembly
36+
run: flutter build web --release --wasm --dart-define=CI=true
37+
working-directory: ./example
38+
39+
- name: Install Linux dependencies
40+
run: |
41+
sudo apt-get update -y
42+
sudo apt-get install -y curl git unzip xz-utils zip libglu1-mesa
43+
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev
44+
45+
- name: Build the Linux app
46+
run: flutter build linux --release --dart-define=CI=true
47+
working-directory: ./example
48+
49+
- name: Build the Android app
50+
run: flutter build appbundle --release --dart-define=CI=true
51+
working-directory: ./example
52+
53+
macos:
54+
name: iOS and macOS apps
55+
runs-on: macos-latest
56+
57+
steps:
58+
- uses: actions/checkout@v4
1759

18-
- name: 🛠️ Set up Flutter
60+
- name: Set up Flutter
1961
uses: subosito/flutter-action@v2
2062
with:
21-
channel: 'stable'
63+
channel: stable
2264
cache: true
2365

24-
- name: 🔍 Verify Flutter installation
66+
- name: Verify Flutter installation
2567
run: flutter --version
2668

27-
- name: 📥 Install Flutter dependencies
69+
- name: Install flutter_quill dependencies
2870
run: flutter pub get
2971

30-
- name: 🌐 Build Flutter Web Application
31-
run: flutter build web --release --verbose --dart-define=CI=true
72+
- name: Install example dependencies
73+
run: flutter pub get -C example
74+
75+
- name: Build the iOS app
76+
run: flutter build ios --no-codesign --release --dart-define=CI=true
77+
working-directory: ./example
78+
79+
- name: Build the macOS app
80+
run: flutter build macos --release --dart-define=CI=true
3281
working-directory: ./example
3382

34-
# TODO: Update the CI to not upgrade all the packages to save some time
35-
- name: 🔄 Update and Upgrade APT Packages
36-
run: sudo apt update -y && sudo apt upgrade -y
83+
windows:
84+
name: Windows app
85+
runs-on: windows-latest
3786

38-
- name: 🛠️ Install Flutter Linux Prerequisites
39-
run: sudo apt install -y curl git unzip xz-utils zip libglu1-mesa
87+
steps:
88+
- uses: actions/checkout@v4
89+
90+
- name: Set up Flutter
91+
uses: subosito/flutter-action@v2
92+
with:
93+
channel: stable
94+
cache: true
95+
96+
- name: Verify Flutter installation
97+
run: flutter --version
98+
99+
- name: Install flutter_quill dependencies
100+
run: flutter pub get
40101

41-
- name: 🧩 Install Flutter Linux Desktop Dependencies
42-
run: sudo apt install -y clang cmake git ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev
102+
- name: Install example dependencies
103+
run: flutter pub get -C example
43104

44-
- name: 🐧 Build Flutter Linux Desktop Application
45-
run: flutter build linux --release --verbose --dart-define=CI=true
105+
- name: Build the Windows app
106+
run: flutter build windows --release --dart-define=CI=true
46107
working-directory: ./example

.github/workflows/changelog.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 📝 Changelog File Check
1+
name: Changelog File Check
22

33
# This workflow only validates if the CHANGELOG.md file was updated and doesn't validate the format.
44

@@ -10,10 +10,10 @@ on:
1010

1111
jobs:
1212
changelog:
13-
name: 🔍 Verify Changelog Modification
13+
name: Verify Changelog Modification
1414
runs-on: ubuntu-latest
1515
steps:
16-
- name: Check if CHANGELOG.md was modified
16+
- name: Check if CHANGELOG.md was modified
1717
uses: tarides/changelog-check-action@v2
1818
with:
1919
changelog: CHANGELOG.md

.github/workflows/checks.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Code Quality Checks
2+
3+
on:
4+
push:
5+
branches: [master, dev]
6+
pull_request:
7+
branches: [master, dev]
8+
9+
jobs:
10+
tests:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Flutter
17+
uses: subosito/flutter-action@v2
18+
with:
19+
channel: stable
20+
cache: true
21+
22+
- name: Verify Flutter installation
23+
run: flutter --version
24+
25+
- name: Install Flutter dependencies
26+
run: flutter pub get
27+
28+
- name: Install flutter_quill_extensions dependencies
29+
run: flutter pub get -C flutter_quill_extensions
30+
31+
- name: Install flutter_quill_test dependencies
32+
run: flutter pub get -C flutter_quill_test
33+
34+
- name: Perform Flutter Analysis
35+
run: flutter analyze
36+
37+
- name: Check Dart code formatting
38+
run: dart format --set-exit-if-changed .
39+
40+
- name: Preview Dart proposed changes
41+
run: dart fix --dry-run
42+
43+
- name: Check if the flutter_quill package is ready for publishing
44+
run: flutter pub publish --dry-run
45+
46+
- name: Check if the flutter_quill_extensions is ready for publishing
47+
run: flutter pub publish --dry-run -C flutter_quill_extensions
48+
49+
- name: Check the translations
50+
run: dart ./scripts/translations_check.dart
51+
52+
- name: Install cider
53+
run: dart pub global activate cider
54+
55+
# TODO: Need a more strict way to validate the format that uses https://keepachangelog.com/en/1.1.0/
56+
- name: Validate CHANGELOG.md format
57+
run: $HOME/.pub-cache/bin/cider list CHANGELOG.md

.github/workflows/main.yml

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

.github/workflows/pr-checks.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: PR Checks
2+
3+
on:
4+
pull_request:
5+
branches: [master, dev]
6+
7+
jobs:
8+
tests:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Set up Flutter
15+
uses: subosito/flutter-action@v2
16+
with:
17+
channel: stable
18+
cache: true
19+
20+
- name: Verify Flutter installation
21+
run: flutter --version
22+
23+
- name: Install Flutter dependencies
24+
run: flutter pub get
25+
26+
- name: Install flutter_quill_extensions dependencies
27+
run: flutter pub get -C flutter_quill_extensions
28+
29+
- name: Install flutter_quill_test dependencies
30+
run: flutter pub get -C flutter_quill_test
31+
32+
- name: Perform Flutter Analysis
33+
run: flutter analyze --write=flutter_analyze.log
34+
35+
- if: ${{ !cancelled() }}
36+
name: Run Flutter Analyze Commenter
37+
uses: yorifuji/flutter-analyze-commenter@v1
38+
with:
39+
analyze-log: flutter_analyze.log
40+
verbose: false

0 commit comments

Comments
 (0)