Skip to content

Commit

Permalink
Merge pull request #1332 from juliansteenbakker/feature/workflows
Browse files Browse the repository at this point in the history
ci: migrate to new coverage and quality actions
  • Loading branch information
juliansteenbakker authored Feb 17, 2025
2 parents b862ab6 + 364fd0d commit 7947e61
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 62 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: 📊 Code Coverage

on: [push, pull_request]

env:
PUB_ENVIRONMENT: bot.github

jobs:
test_with_coverage:
name: 🧪 Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
# Checkout the Repository
- name: 📥 Checkout Repository
uses: actions/checkout@v4

# Setup Flutter SDK with Cache
- name: ⚡ Set Up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true

# Cache Pub Dependencies
- name: 📦 Cache Pub Dependencies
uses: actions/cache@v3
with:
path: |
~/.pub-cache
.dart_tool
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.yaml') }}
restore-keys: |
${{ runner.os }}-pub-
# Install Project Dependencies
- name: 🚀 Install Dependencies
run: flutter pub get

# Run Tests with Code Coverage
- name: ✅ Run Unit Tests with Coverage
run: flutter test --coverage

# Upload Coverage Report as Artifact
- name: 📊 Upload Coverage Report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/lcov.info

# Upload Coverage to Codecov
- name: ☁️ Upload Coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/lcov.info
flags: unittests
name: codecov-flutter
fail_ci_if_error: true
65 changes: 65 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: 📝 Code Quality

on: [push, pull_request]

defaults:
run:
shell: bash

env:
PUB_ENVIRONMENT: bot.github

jobs:
analysis:
name: 🔍 Analysis
runs-on: ubuntu-latest

steps:
- name: 📥 Checkout Code
uses: actions/checkout@v4

- name: ⚡ Set Up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true

- name: 🔍 Flutter Version Info
run: flutter doctor -v

- name: 📦 Cache Pub Dependencies
uses: actions/cache@v3
with:
path: |
~/.pub-cache
.dart_tool
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.yaml') }}
restore-keys: |
${{ runner.os }}-pub-
- name: 🔧 Bootstrap Workspace
run: flutter pub get

- name: ✅ Lint Code
run: flutter analyze

formatting:
name: 🎨 Formatting
needs: analysis # This makes formatting start after analysis is complete
runs-on: ubuntu-latest

steps:
- name: 📥 Checkout Code
uses: actions/checkout@v4

- name: ⚡ Set Up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true

- name: 🔧 Bootstrap Workspace
run: flutter pub get

- name: 🎯 Check Code Formatting
run: dart format --set-exit-if-changed .
62 changes: 0 additions & 62 deletions .github/workflows/flutter.yml

This file was deleted.

0 comments on commit 7947e61

Please sign in to comment.