pre-commit-terraform icon indicating copy to clipboard operation
pre-commit-terraform copied to clipboard

ci: Add tests for arm64 and for macOS

Open MaxymVlasov opened this issue 1 year ago β€’ 5 comments

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

MaxymVlasov avatar Feb 23 '24 21:02 MaxymVlasov

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?

antm-pp avatar Feb 23 '24 23:02 antm-pp

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

MaxymVlasov avatar Feb 24 '24 05:02 MaxymVlasov

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.

MaxymVlasov avatar Feb 24 '24 05:02 MaxymVlasov

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.

antm-pp avatar Feb 27 '24 13:02 antm-pp

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

github-actions[bot] avatar Apr 05 '24 00:04 github-actions[bot]

πŸ“ 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.

❀️ Share
πŸͺ§ 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 @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in 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 pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere 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.

coderabbitai[bot] avatar May 27 '25 22:05 coderabbitai[bot]

This works for mac x64. Mac arm still need to figure out how to fix. Better do as separate PR

MaxymVlasov avatar May 31 '25 13:05 MaxymVlasov