Skip to content

Conversation

@vbuberen
Copy link
Collaborator

@vbuberen vbuberen commented Oct 9, 2022

Description

Introduced build matrix so tests run against multiple Android versions. It should help us to be sure that functionality of the plugin isn't broken by some change.

This PR has matrix only for Android alarm manager plus to get initial feedback. If other maintainers agree with suggested strategies in the next PR I will add similar changes for all plugins at once.

Initially I wanted to have 19 as a minimal version, but on 19 I saw such error:
Screenshot 2022-10-09 at 19 43 37

So it seems that integration_test doesn't work well with old APIs.
Mid version corresponds to Android O, which is something in the middle of the suggested range.
Max version is 32 as 33 acted strange during my tests on fork.

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I titled the PR using Conventional Commits.
  • I did not modify the CHANGELOG.md nor the pubspec.yaml files.
  • All existing and new tests are passing.
  • The analyzer (flutter analyze) does not report any problems on my PR.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate that with a ! in the title as explained in Conventional Commits).
  • No, this is not a breaking change.

@vbuberen vbuberen added android_alarm_manager_plus CI/CD Everything related to automated builds and deployments labels Oct 9, 2022
# Required for Android builds
- uses: actions/setup-java@v1
# Required for Android builds
- uses: actions/setup-java@v2
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I experimented with removing this step as suggested in one of other PRs (because of https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#java saying that such runners already have Java 11), but couldn't build the project due to missing Java 11. Thus, returned the step again.

# Required for Android builds
- uses: actions/setup-java@v2
with:
distribution: "temurin"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setup-java in v2 requires to specify the distribution type, thus, this addition.

api-level: 30
arch: x86_64
api-level: ${{ matrix.android-api-level }}
cores: 3
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MacOS runner has 3 cores available, while android-emulator-runner uses 2 by default. Specifying this value in effort to get higher performance.

Copy link
Member

@miquelbeltran miquelbeltran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, let's see if the CI gods keep everything green ;)

Comment on lines +44 to +46
strategy:
matrix:
android-api-level: [21, 26, 32]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh that's cool, simpler than what I thought.

@vbuberen vbuberen merged commit b67a1d4 into fluttercommunity:main Oct 10, 2022
@vbuberen vbuberen deleted the update/android_tests_matrix branch October 10, 2022 11:06
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

android_alarm_manager_plus CI/CD Everything related to automated builds and deployments hacktoberfest-accepted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants