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

test(ci): upgrade macOS runner to M1 & macOS 14 #15367

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

david-allison
Copy link
Member

Purpose / Description

This is a beta, we are currently on macos-12

https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/

The macos-latest workflow label currently uses the macOS 12 runner image.
macos-14 [beta]

https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories

This reduces the available RAM from 14 to 7GB

How Has This Been Tested?

This is the test

Learning (optional, can help others)

https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/

https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories

Virtual Machine Processor (CPU) Memory (RAM) Storage (SSD) OS (YAML workflow label) Notes
macOS 3 14 GB 14 GB macos-latest, macos-12, macos-11 The macos-latest workflow label currently uses the macOS 12 runner image.
macOS 4 14 GB 14 GB macos-13 N/A
macOS 3 (M1) 7 GB 14 GB macos-14 [Beta] N/A

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

@david-allison david-allison force-pushed the upgrade-macos-runner branch 2 times, most recently from 861038b to 8d59f65 Compare January 31, 2024 01:57
@mikehardy
Copy link
Member

macos the fastest now as I silently suspected it would be

Copy link
Member

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

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

Looks fine to me and appears to run quite well based on scan of the CI log

Nice!

@david-allison

This comment was marked as outdated.

@david-allison

This comment was marked as outdated.

@david-allison

This comment was marked as outdated.

@david-allison
Copy link
Member Author

Emulator tests blocked on:

HVF error: HV_UNSUPPORTED
qemu-system-aarch64-headless: failed to initialize HVF: Invalid argument
WARNING | QEMU main loop exits abnormally with code 1

HV_UNSUPPORTED

@david-allison
Copy link
Member Author

david-allison commented Jan 31, 2024

@mikehardy Would you accept this PR if:

  • we upgrade to macos-14 for unit tests
  • we add a link to tests_emulator EITHER:
    1. GitHub issue to look over our emulator configs [including upgrading our emulator runner]
    2. Link to the upstream issue

@david-allison david-allison added the Needs reviewer reply Waiting for a reply from another reviewer label Jan 31, 2024
@mikehardy
Copy link
Member

yeah - getting the unit tests going on apple silicon will speed them up, that's worthwhile
might just quickly change the number of threads in CI in the build gradle since they're all 4 vCPU now, and maybe stop doing the in-process kotlin compile? Those are both just toggles and might speed up windows as a quick extra-commit-win

future investigation may be to revive the old emulator test workflow we had that did nested virt on ubuntu to get the emulator to run there and convert tests emulator back to ubuntu ? but keeping it on macos-current is fine for now, incremental steps are positive steps

@david-allison david-allison added Needs Second Approval Has one approval, one more approval to merge and removed Needs reviewer reply Waiting for a reply from another reviewer labels Jan 31, 2024
@david-allison
Copy link
Member Author

@mikehardy marking this as being up for second review given your comment. Low priority to check you're happy with the comment on tests_emulator.yml

@david-allison
Copy link
Member Author

Maintainers:

this requires an update to branch protection rules before merge.
Specifically: Unit Tests / JUnit Tests (macos-14 should replace Unit Tests / JUnit Tests (macos-latest

https://github.com/ankidroid/Anki-Android/settings/branch_protection_rules/17281133

Please also see the following, which should be merged at a similar time, as this fixes a typo in the above

Copy link
Member

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

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

yolo merge, but honestly I don't think it can be improved, it's a simple switch at this point

@mikehardy mikehardy merged commit 2ca67ed into ankidroid:main Jan 31, 2024
7 checks passed
@github-actions github-actions bot added this to the 2.17 release milestone Jan 31, 2024
@github-actions github-actions bot removed the Needs Second Approval Has one approval, one more approval to merge label Jan 31, 2024
@mikehardy
Copy link
Member

The main branch protection rules have potentially "unstable" names, in that the version of the macos/linux/ubuntu runner is currently included in the name, implying that if we change the name from the mostly stable "latest" (e.g., "macos-latest") to a specific version (e.g., "macos-14") the branch protection rules must be updated

I believe there is a way to specify the name programmatically, such that inside the matrix you may expect the context and get the current matrix expansion, then use an expression (like, with contains https://docs.github.com/en/actions/learn-github-actions/expressions#example-using-a-string) and from that set name

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