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

ci: run arm64 tests on macOS #2085

Closed
wants to merge 20 commits into from
51 changes: 49 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,34 @@ permissions:
contents: read

jobs:
test-mac:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os:
- macos-12
- macos-13
- macos-14

steps:
- name: install docker on ${{ runner.arch}}
run: |
# macos-14 is missing colima
brew install colima docker

- run: colima version && limactl --version && qemu-img --version

- run: colima start

- run: cat /Users/runner/.colima/_lima/colima/ha.stderr.log
if: always()

- run: colima status

setup:
runs-on: ubuntu-latest
needs: test-mac
permissions:
contents: read
checks: write
Expand Down Expand Up @@ -176,7 +202,8 @@ jobs:
run: docker buildx bake test-distro

lang:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
name: ${{ matrix.tag }} (${{ matrix.os == 'ubuntu-latest' && 'amd64' || 'arm64' }})
needs:
- base
- bats
Expand Down Expand Up @@ -205,11 +232,30 @@ jobs:
- rust
- swift
- latest
os:
- ubuntu-latest
- macos-14 # https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/

env:
TAG: ${{ matrix.tag }}

steps:
- name: install docker
if: runner.os == 'macos'
run: |
# macos-14 is missing colima
brew install colima docker docker-buildx

# Link plugins to docker
mkdir -p ~/.docker/cli-plugins
ln -sfn $(which docker-buildx) ~/.docker/cli-plugins

# start docker
colima start --mount-type 9p

# disable apt proxy on macos
echo 'APT_HTTP_PROXY=' >> $GITHUB_ENV

- name: docker-config
uses: containerbase/internal-tools@6bbc5c952921fd03b8bb242934e57dc8d3d2be1b # v3.0.51
with:
Expand All @@ -227,12 +273,13 @@ jobs:
uses: ./.github/actions/setup-node

- name: prepare apt proxy
if: runner.os == 'linux'
run: sudo pnpm prepare:proxy

- name: build
run: pnpm build

- name: test
run: docker buildx bake test
run: docker buildx bake test-${{ runner.arch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ group "test-distro" {
targets = ["build-distro"]
}

group "test-X64" {
targets = ["build-test"]
}

group "test-ARM64" {
targets = ["build-arm64"]
}


target "settings" {
context = "."
Expand Down
Loading