[WIP] ci: Update CI runners #186
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: test | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- 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 | |
native_ios_tests: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- 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: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
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: | |
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 | |
run: cd example/android && gradle workmanager:test | |
drive_ios: | |
strategy: | |
matrix: | |
device: | |
- "iPhone 15" | |
fail-fast: false | |
runs-on: macos-latest | |
steps: | |
- uses: futureware-tech/simulator-action@v3 | |
with: | |
model: '${{ matrix.device }}' | |
- uses: actions/checkout@v4 | |
- 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: ubuntu-latest | |
#creates a build matrix for your jobs | |
timeout-minutes: 30 | |
strategy: | |
#set of different configurations of the virtual environment. | |
matrix: | |
api-level: [31] | |
# api-level: [21, 29] | |
target: [google_apis] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
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 |