pre-commit-terraform
pre-commit-terraform copied to clipboard
ci: Add tests for arm64 and for macOS
Put an x into the box if that apply:
- [ ] This PR introduces breaking change.
- [ ] This PR fixes a bug.
- [ ] This PR adds new functionality.
- [x] This PR enhances existing functionality.
Description of your changes
How can we test changes
Blocked by https://github.com/plexsystems/container-structure-test-action/issues/6
You may understand this better than me (and appreciate it's a work in progress so not trying to review it).
The macos-latest github runner is an amd host, and the only arm host is macos-14 (beta)
The ubuntu-latest (for private repo) is running in Azure according to this spec, and indicates it's an Intel(amd) processor.
I think there's limited ability to run an arm host as a github runner.
In terms of outcomes, (despite the comments on the other PR I've made about seeing differences between aarch64/arm64) isn't the principle test just for a build with buildx arg --platform linux/arm64 as well as the current linux/amd64. Effectively the whole workflow in parallel rather than just the multi-arch build step?
arm64 exist for macOS 13. GH just not updated their docs https://docs.github.com/en/actions/using-github-hosted-runners/about-larger-runners/about-larger-runners
And matrix is a parallelism by itself, we build multiplatform image just to test that this will work, during the release
Check run workflows for the last commit https://github.com/antonbabenko/pre-commit-terraform/actions/runs/8025437914
If there were no possibility to run arm64 runners, jobs would not start at all
I will take a look at the container structure GHA next week. if it can be quickly fixed, I will use my fork (as it was some time ago), and merge this PR with all 4 checks.
If not - well, 2 arches for Ubuntu are still better than just 1 Ubuntu amd64 build.
Then we will be able to test your PR right away in GHA, just in case.
So the matrix defined still only uses runs-on {{ matrix.os }} so how does the runs-on command have any concept of the architecture? I've never seen anything in github documentation to say they provide arm64 hosts (other than the recent addition of the Mac M1 processor). I can't see anywhere in the workflow that utilises the architecture specified.
This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 10 days
π Walkthrough
Summary by CodeRabbit
- Chores
- Expanded build and test coverage to include MacOS runners (both amd64 and arm64) in addition to existing Ubuntu runners.
- Improved workflow reliability by disabling early termination on failure.
- Enhanced Docker setup for MacOS runners to ensure compatibility and proper environment configuration.
- Updated debug and binary download steps for broader OS support.
Summary by CodeRabbit
- Chores
- Updated automated build and test workflows to support both Linux and MacOS runners, including MacOS for both amd64 and arm64 architectures.
- Improved workflow reliability by preventing early termination on failure.
- Enhanced Docker setup and testing compatibility for MacOS environments.
Walkthrough
The build workflow configuration was updated to add MacOS amd64 and arm64 runners to the build matrix. A MacOS-specific step was introduced to set up Docker using a dedicated action before the Docker Buildx setup, conditional on Docker-related files changing.
Changes
| File(s) | Change Summary |
|---|---|
| .github/workflows/build-image-test.yaml | Added os-type dimension with linux and darwin to build matrix; included MacOS amd64 and arm64 runners; introduced MacOS-only Docker setup step; updated container-structure-test URL to support MacOS binaries; set fail-fast to false; modified IMAGE env variable assignment. |
Sequence Diagram(s)
sequenceDiagram
participant GitHub Actions
participant MacOS Runner
participant Setup Docker Action
participant Docker Buildx
GitHub Actions->>MacOS Runner: Start job with matrix.os-type=darwin
MacOS Runner->>Setup Docker Action: Run douglascamata/[email protected]
Setup Docker Action->>MacOS Runner: Docker environment ready
MacOS Runner->>Docker Buildx: Proceed with Docker Buildx setup and build steps
Suggested reviewers
- antonbabenko
π Recent review details
Configuration used: .coderabbit.yaml Review profile: CHILL Plan: Pro
π₯ Commits
Reviewing files that changed from the base of the PR and between dc6a9394277f3a817d60c31e33a23bb0efae341f and 948df60a77b6e4a4817ff33473f856ae75e296e6.
π Files selected for processing (1)
.github/workflows/build-image-test.yaml(4 hunks)
π§ Files skipped from review as they are similar to previous changes (1)
- .github/workflows/build-image-test.yaml
β° Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: MacOS ARM
- GitHub Check: MacOS x64
- GitHub Check: Ubuntu x64
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
πͺ§ Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Explain this complex logic.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai explain this code block.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and explain its main purpose.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
Support
Need help? Create a ticket on our support page for assistance with any issues or questions.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate docstringsto generate docstrings for this PR.@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
This works for mac x64. Mac arm still need to figure out how to fix. Better do as separate PR