Skip to content

fix: Github Actions Workflow Checks and Tests are now working again; dependencies updated #597

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rfowler5
Copy link

@rfowler5 rfowler5 commented Apr 12, 2025

I updated the example app and github actions workflow test.yaml to the latest dependencies so that the tests are now passing.

The one thing I could not figure out how to fix was the dart format test. On my local machine (macOS), dart format changes 0 files (Formatted 8 files; changed 0 files is the output). However, on the github actions, dart format changes 6 files (!). From looking at a git diff, the dart format from github actions seems to be doing something different than on my machine (whether in a terminal in VSCode or in a general terminal) .

The changes are numerous tiny things that are difficult to fix, and they don't have anything to do with the app's functionality (which is what I was most concerned about: Is this app still working despite failing checks, and can we get the tests working again to see?), so I had to call it a day. Maybe someone else can figure out how to fix that test too.

Regardless of whether these changes are accepted or not, I can confirm that all the tests (except dart format) run successfully with the latest changes on the main branch (commit 4ce0651), closing my own issue I opened #593 (comment).

Changes

  • The example app's pubspec.yaml was relying on the pub.dev version of Flutter Workmanager, which is at 0.5.2. That version of Workmanager does not have the new fields and functions that were added later and hence the Android and ios builds were failing when running the workflow actions.

    • I fixed this by updating pubspec.yaml to point to the main branch of the Flutter Workmanager git repo. This is obviously not a great solution, but I see no way out of it until pub.dev is updated, if we want to ensure the tests are working as Workmanager is updated. I added a comment in the pubspec.yaml to that end so that devs can remember to update the pubspec.yaml to point back to pub.dev eventually.
  • The example app's android compileSdk and ndkVersion were out of date. I updated the app/build.gradle accordingly. As a result, a bunch of updates were applied to Android also, as can be seen.

  • The example app's ios had an outdated target (ios 9) for flutter_permission handler. I updated this to 12, which also ended up updating a few files in the ios folder too, since i had to run a pod install.

  • I had to adjust the version of iPhone targeted to iPhone 15 Pro to match the latest version of mac that the test.yaml was targeting (macos-latest), per the error message I was getting (Error: No devices found for the matching requirements. See https://github.com/futureware-tech/simulator-action/wiki for the list of available devices). This was causing the drive ios test to crash and therefore fail. Accordingly, I also updated the native ios test: updated to iPhone 15 17.4.

  • I had to adjust the emulator in drive android. To do this, I switched to ubuntu and applied the recommended changes for that. The emulator for android previously was not starting, and so this test would fail. Another upside of switching to ubuntu is that it runs 2-3 times faster, according to the git repo for the android emulator runner.

  • I had to add a Readme.md file to the workmanager folder. I left it largely blank to be filled in by the devs if they want. The lack of the Readme was causing the format publishable test to fail.

Copy link

docs-page bot commented Apr 12, 2025

To view this pull requests documentation preview, visit the following URL:

docs.page/fluttercommunity/flutter_workmanager~597

Documentation is deployed and generated using docs.page.

@rfowler5 rfowler5 changed the title Fix: Github Actions Workflow Checks and Tests are now working again; dependencies updated fix: Github Actions Workflow Checks and Tests are now working again; dependencies updated Apr 12, 2025
@gfmr806
Copy link

gfmr806 commented Apr 23, 2025

confirm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants