Skip to content

Commit

Permalink
chore: Split ci coverage job (#179)
Browse files Browse the repository at this point in the history
* chore: Split coverage job

* chore: Set timeout-minutes

* Update .github/workflows/test.yml

Co-authored-by: Jonas Finnemann Jensen <[email protected]>

* chore: Set timeout-minutes 15

---------

Co-authored-by: Jonas Finnemann Jensen <[email protected]>
  • Loading branch information
koji-1009 and jonasfj authored Dec 3, 2024
1 parent 12ca012 commit b2cdb85
Showing 1 changed file with 60 additions and 22 deletions.
82 changes: 60 additions & 22 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
lints:
name: Format + Lints
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
Expand All @@ -24,6 +25,7 @@ jobs:
linux:
name: Linux desktop / Chrome / Firefox
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
Expand All @@ -50,19 +52,10 @@ jobs:
--target=integration_test/webcrypto_test.dart \
-d chrome
- run: xvfb-run flutter pub run test -p vm,chrome,firefox
# Test with coverage collection as a separate step.
# This will run in debug mode, so we test both with and without coverage.
- run: xvfb-run flutter pub run test -p vm,chrome,firefox --coverage ./coverage
# Report collected coverage
- name: Convert coverage to lcov
run: dart run coverage:format_coverage -i ./coverage -o ./coverage/lcov.info --lcov --report-on lib/
- uses: coverallsapp/github-action@v2
with:
flag-name: linux
parallel: true
macos-14:
name: MacOS 14 desktop / Chrome / Firefox
runs-on: macos-14 # Test with xcode 15
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
Expand Down Expand Up @@ -98,6 +91,7 @@ jobs:
macos-15:
name: MacOS 15 desktop / Chrome / Firefox
runs-on: macos-15 # Test with xcode 16
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
Expand Down Expand Up @@ -125,6 +119,7 @@ jobs:
windows:
name: Windows desktop / Chrome / Firefox
runs-on: windows-latest
timeout-minutes: 15
steps:
- uses: ilammy/setup-nasm@v1
- uses: actions/checkout@v4
Expand All @@ -151,19 +146,10 @@ jobs:
--target=integration_test/webcrypto_test.dart \
-d chrome
- run: flutter pub run test -p vm,chrome,firefox
# Test with coverage collection as a separate step.
# This will run in debug mode, so we test both with and without coverage.
- run: flutter pub run test -p vm,chrome,firefox --coverage ./coverage
# Report collected coverage
- name: Convert coverage to lcov
run: dart run coverage:format_coverage -i ./coverage -o ./coverage/lcov.info --lcov --report-on lib/
- uses: coverallsapp/github-action@v2
with:
flag-name: windows
parallel: true
ios:
name: iOS emulator (iPhone)
runs-on: macos-14
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
Expand All @@ -182,6 +168,7 @@ jobs:
android:
name: Android emulator
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
Expand All @@ -207,12 +194,63 @@ jobs:
api-level: 28
working-directory: ./example
script: flutter test integration_test/webcrypto_test.dart -d android
linux-coverage:
name: Linux desktop / Chrome / Firefox (coverage)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: Configure Flutter
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev
flutter config --no-analytics
- run: flutter pub get
- run: flutter pub run webcrypto:setup
- run: xvfb-run flutter pub run test -p vm,chrome,firefox --coverage ./coverage
# Report collected coverage
- name: Convert coverage to lcov
run: dart run coverage:format_coverage -i ./coverage -o ./coverage/lcov.info --lcov --report-on lib/
- uses: coverallsapp/github-action@v2
with:
flag-name: linux
parallel: true
windows-coverage:
name: Windows desktop / Chrome / Firefox (coverage)
runs-on: windows-latest
timeout-minutes: 15
steps:
- uses: ilammy/setup-nasm@v1
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: Configure Flutter
run: |
flutter config --no-analytics
- run: flutter pub get
- run: flutter pub run webcrypto:setup
- run: flutter test
- run: flutter pub run test -p vm,chrome,firefox --coverage ./coverage
# Report collected coverage
- name: Convert coverage to lcov
run: dart run coverage:format_coverage -i ./coverage -o ./coverage/lcov.info --lcov --report-on lib/
- uses: coverallsapp/github-action@v2
with:
flag-name: windows
parallel: true
coverage:
name: Report to coveralls
runs-on: ubuntu-latest
timeout-minutes: 15
needs:
- linux
- windows
- linux-coverage
- windows-coverage
steps:
- uses: coverallsapp/github-action@v2
with:
Expand Down

0 comments on commit b2cdb85

Please sign in to comment.