-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
11 changed files
with
188 additions
and
203 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
paths-ignore: | ||
- '**.md' | ||
pull_request: | ||
branches: [ main ] | ||
paths-ignore: | ||
- '**.md' | ||
|
||
jobs: | ||
flutter-tests: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: '3.29.0' | ||
channel: 'stable' | ||
|
||
- name: Install dependencies | ||
run: flutter pub get | ||
|
||
- name: Analyze project source | ||
run: flutter analyze --fatal-infos | ||
working-directory: lib | ||
|
||
- name: Run tests | ||
run: flutter test --coverage | ||
|
||
- name: Upload coverage report as artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: flutter-coverage | ||
path: coverage/lcov.info | ||
|
||
ios-tests: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: '3.29.0' | ||
channel: 'stable' | ||
|
||
- name: Install dependencies | ||
run: | | ||
brew install xcresultparser | ||
flutter pub get | ||
cd example/ios | ||
pod install | ||
cd ../.. | ||
- name: Run tests | ||
run: | | ||
xcodebuild test -workspace ./example/ios/Runner.xcworkspace \ | ||
-scheme EventideTests \ | ||
-destination 'platform=iOS Simulator,name=iPhone 16,OS=18.1' \ | ||
-resultBundlePath build/reports/EventideTests.xcresult | ||
- name: Prepare coverage xml file | ||
run: | | ||
xcresultparser \ | ||
--output-format cobertura \ | ||
build/reports/EventideTests.xcresult > build/reports/ios-coverage.xml | ||
- name: Upload coverage report as artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ios-coverage | ||
path: build/reports/ios-coverage.xml | ||
|
||
android-tests: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'corretto' | ||
java-version: '17' | ||
cache: 'gradle' | ||
|
||
- uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: '3.29.0' | ||
channel: 'stable' | ||
|
||
- name: Install dependencies | ||
run: flutter pub get | ||
|
||
- name: Build and test | ||
run: | | ||
./example/android/gradlew testDebugUnitTest -p ./example/android/ | ||
- name: Upload coverage report as artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: android-coverage | ||
path: ./android/build/reports/jacocoTestReport.xml | ||
|
||
upload-coverage: | ||
runs-on: ubuntu-latest | ||
needs: [flutter-tests, ios-tests, android-tests] | ||
steps: | ||
- name: Download flutter coverage report | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: flutter-coverage | ||
path: coverage | ||
|
||
- name: Download ios coverage report | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ios-coverage | ||
path: build/reports | ||
|
||
- name: Download android coverage report | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: android-coverage | ||
path: ./android/build/reports/ | ||
|
||
- name: Upload combined coverage report to Codecov | ||
uses: codecov/codecov-action@v5 | ||
env: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
with: | ||
fail_ci_if_error: true | ||
files: ./coverage/lcov.info,./build/reports/ios-coverage.xml,./android/build/reports/jacocoTestReport.xml |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.