Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] ci: Update CI runners #566

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v1
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
java-version: 21
- uses: subosito/flutter-action@v2
with:
channel: "stable"
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,4 @@ jobs:
cd workmanager
flutter pub get
flutter pub publish -n
flutter pub global activate tuneup
flutter pub global run tuneup check
flutter pub dart analyze
6 changes: 6 additions & 0 deletions .github/workflows/scripts/install-flutter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

BRANCH=$1

git clone https://github.com/flutter/flutter.git --depth 1 -b $BRANCH _flutter
echo "$GITHUB_WORKSPACE/_flutter/bin" >>$GITHUB_PATH
10 changes: 10 additions & 0 deletions .github/workflows/scripts/install-tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -e

flutter config --no-analytics
flutter pub global activate melos 3.0.0
echo "$HOME/.pub-cache/bin" >>$GITHUB_PATH
echo "$HOME/AppData/Local/Pub/Cache/bin" >>$GITHUB_PATH
echo "$GITHUB_WORKSPACE/_flutter/.pub-cache/bin" >>$GITHUB_PATH
echo "$GITHUB_WORKSPACE/_flutter/bin/cache/dart-sdk/bin" >>$GITHUB_PATH
77 changes: 53 additions & 24 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: "Install Flutter"
run: ./.github/workflows/scripts/install-flutter.sh stable
- name: "Install Tools"
run: |
./.github/workflows/scripts/install-tools.sh
- name: Test
run: |
melos bootstrap
cd workmanager
flutter pub get
flutter test
Expand All @@ -24,24 +27,37 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: "Install Flutter"
run: ./.github/workflows/scripts/install-flutter.sh stable
- name: "Install Tools"
run: |
./.github/workflows/scripts/install-tools.sh
- name: Build iOS App
run: cd example && flutter build ios --debug --no-codesign
- name: Run native iOS tests
run: cd example/ios && xcodebuild -workspace Runner.xcworkspace -scheme Runner -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 12,OS=16.2' test

native_android_tests:
runs-on: macos-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v1
- uses: actions/setup-java@v4
with:
java-version: 17
- uses: subosito/flutter-action@v1
distribution: 'temurin'
java-version: 21
- name: "Install Flutter"
run: ./.github/workflows/scripts/install-flutter.sh stable
- name: "Install Tools"
run: |
./.github/workflows/scripts/install-tools.sh
- name: Run Flutter Driver tests
uses: reactivecircus/android-emulator-runner@v2
with:
channel: 'stable'
arch: x86_64
profile: Nexus 6
api-level: 34
target: google_apis
script: cd example && flutter test integration_test/workmanager_integration_test.dart
- name: Build Android App
run: cd example && flutter build apk --debug
- name: Run native Android tests
Expand All @@ -51,42 +67,55 @@ jobs:
strategy:
matrix:
device:
- "iPhone 12 Pro"
- "iPhone 15"
fail-fast: false
runs-on: macos-latest
steps:
- uses: futureware-tech/simulator-action@v1
- uses: futureware-tech/simulator-action@v3
with:
model: '${{ matrix.device }}'
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: "Install Flutter"
run: ./.github/workflows/scripts/install-flutter.sh stable
- name: "Install Tools"
run: |
./.github/workflows/scripts/install-tools.sh
# Run flutter integrate tests
- name: Run Flutter integration tests
run: cd example && flutter test integration_test/workmanager_integration_test.dart


drive_android:
runs-on: macos-latest
runs-on: ubuntu-latest
#creates a build matrix for your jobs
timeout-minutes: 30
strategy:
#set of different configurations of the virtual environment.
matrix:
api-level: [29]
api-level: [31]
# api-level: [21, 29]
target: [default]
target: [google_apis]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v1
with:
java-version: 17
- uses: subosito/flutter-action@v2
- uses: actions/setup-java@v4
with:
channel: 'stable'
distribution: 'temurin'
java-version: 21
- name: "Install Flutter"
run: ./.github/workflows/scripts/install-flutter.sh stable
- name: "Install Tools"
run: |
./.github/workflows/scripts/install-tools.sh
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Run Flutter Driver tests
uses: reactivecircus/android-emulator-runner@v2
with:
# arch: x86_64
profile: Nexus 6
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
script: cd example && flutter test integration_test/workmanager_integration_test.dart
Loading