Skip to content

Commit 7947e61

Browse files
Merge pull request #1332 from juliansteenbakker/feature/workflows
ci: migrate to new coverage and quality actions
2 parents b862ab6 + 364fd0d commit 7947e61

File tree

3 files changed

+125
-62
lines changed

3 files changed

+125
-62
lines changed

.github/workflows/code-coverage.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: 📊 Code Coverage
2+
3+
on: [push, pull_request]
4+
5+
env:
6+
PUB_ENVIRONMENT: bot.github
7+
8+
jobs:
9+
test_with_coverage:
10+
name: 🧪 Unit Tests
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 20
13+
14+
steps:
15+
# Checkout the Repository
16+
- name: 📥 Checkout Repository
17+
uses: actions/checkout@v4
18+
19+
# Setup Flutter SDK with Cache
20+
- name: ⚡ Set Up Flutter
21+
uses: subosito/flutter-action@v2
22+
with:
23+
channel: stable
24+
cache: true
25+
26+
# Cache Pub Dependencies
27+
- name: 📦 Cache Pub Dependencies
28+
uses: actions/cache@v3
29+
with:
30+
path: |
31+
~/.pub-cache
32+
.dart_tool
33+
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.yaml') }}
34+
restore-keys: |
35+
${{ runner.os }}-pub-
36+
37+
# Install Project Dependencies
38+
- name: 🚀 Install Dependencies
39+
run: flutter pub get
40+
41+
# Run Tests with Code Coverage
42+
- name: ✅ Run Unit Tests with Coverage
43+
run: flutter test --coverage
44+
45+
# Upload Coverage Report as Artifact
46+
- name: 📊 Upload Coverage Report
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: coverage-report
50+
path: coverage/lcov.info
51+
52+
# Upload Coverage to Codecov
53+
- name: ☁️ Upload Coverage to Codecov
54+
uses: codecov/codecov-action@v5
55+
with:
56+
token: ${{ secrets.CODECOV_TOKEN }}
57+
files: coverage/lcov.info
58+
flags: unittests
59+
name: codecov-flutter
60+
fail_ci_if_error: true

.github/workflows/code-quality.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: 📝 Code Quality
2+
3+
on: [push, pull_request]
4+
5+
defaults:
6+
run:
7+
shell: bash
8+
9+
env:
10+
PUB_ENVIRONMENT: bot.github
11+
12+
jobs:
13+
analysis:
14+
name: 🔍 Analysis
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: 📥 Checkout Code
19+
uses: actions/checkout@v4
20+
21+
- name: ⚡ Set Up Flutter
22+
uses: subosito/flutter-action@v2
23+
with:
24+
channel: stable
25+
cache: true
26+
27+
- name: 🔍 Flutter Version Info
28+
run: flutter doctor -v
29+
30+
- name: 📦 Cache Pub Dependencies
31+
uses: actions/cache@v3
32+
with:
33+
path: |
34+
~/.pub-cache
35+
.dart_tool
36+
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.yaml') }}
37+
restore-keys: |
38+
${{ runner.os }}-pub-
39+
40+
- name: 🔧 Bootstrap Workspace
41+
run: flutter pub get
42+
43+
- name: ✅ Lint Code
44+
run: flutter analyze
45+
46+
formatting:
47+
name: 🎨 Formatting
48+
needs: analysis # This makes formatting start after analysis is complete
49+
runs-on: ubuntu-latest
50+
51+
steps:
52+
- name: 📥 Checkout Code
53+
uses: actions/checkout@v4
54+
55+
- name: ⚡ Set Up Flutter
56+
uses: subosito/flutter-action@v2
57+
with:
58+
channel: stable
59+
cache: true
60+
61+
- name: 🔧 Bootstrap Workspace
62+
run: flutter pub get
63+
64+
- name: 🎯 Check Code Formatting
65+
run: dart format --set-exit-if-changed .

.github/workflows/flutter.yml

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

0 commit comments

Comments
 (0)