diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d42548ed898..c37d367d6ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,10 +10,13 @@ concurrency: jobs: ci: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: + os: + - ubuntu-latest + - macos-latest # arm64 runner suite: - { path: bin, name: dry_run, ecosystem: common } - { path: bun, name: bun, ecosystem: bun } @@ -57,6 +60,20 @@ jobs: token: '' # use git commands to avoid excessive rate limit usage filters: .github/ci-filters.yml + - name: Install Docker + if: matrix.os == 'macos-latest' + run: | + brew install --cask docker + brew install docker-buildx + CONFIG="$HOME/.docker/config.json" + PLUGIN_DIR="/opt/homebrew/lib/docker/cli-plugins" + + if [ ! -f "$CONFIG" ]; then + echo '{ "cliPluginsExtraDirs": ["'"$PLUGIN_DIR"'"] }' > "$CONFIG" + else + jq '.cliPluginsExtraDirs |= ( . // [] | . + ["'"$PLUGIN_DIR"'"] | unique )' "$CONFIG" > "$CONFIG.tmp" && mv "$CONFIG.tmp" "$CONFIG" + fi + - name: Build ecosystem image if: steps.changes.outputs[matrix.suite.path] == 'true' run: script/build ${{ matrix.suite.path }}