Swift package manager support #53
Workflow file for this run
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
name: CI | |
on: | |
push: | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
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 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
files: coverage/lcov.info,build/reports/ios-coverage.xml,android/build/reports/jacocoTestReport.xml |