Skip to content

2.x: Using colima with docker in MacOS #9

2.x: Using colima with docker in MacOS

2.x: Using colima with docker in MacOS #9

name: '2.x: MacOS - Build ce_dev binaries, images and templates (test)'
on:
push:
branches:
- 2.x-devel
jobs:
build:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
with:
ref: '2.x-devel'
- name: Install modules
run: yarn
# Uses https://oclif.io/
# Not strictly necessary here, but ensures the packing works
- name: Pack the JS
run: yarn oclif pack tarballs --targets=darwin-x64,darwin-arm64 --no-xz
- name: Rename the dist/* files
run: yarn renamedist
- name: Install homebrew dependencies
run: |
set -x
sudo chmod ugo+w /usr/local/bin
brew install --overwrite [email protected]
brew install docker docker-compose lima
# brew install mysql-client is failing because of existing 2to3
sudo rm -f /usr/local/bin/2to3*
brew install --overwrite mysql-client || true
- name: Install and start Colima
run: |
brew install colima
colima version
colima start --cpu 3 --memory 6 --disk 100 --vm-type=qemu --mount-type=sshfs --dns=1.1.1.1
# We build mkcert from source because releases are broken
- name: Install test dependencies
run: |
brew update
brew upgrade
brew install p7zip nss wget
cd /tmp
wget https://go.dev/dl/go1.22.1.darwin-arm64.tar.gz
sudo tar -C /usr/local -xzf go1.22.1.darwin-arm64.tar.gz
export PATH=$PATH:/usr/local/go/bin
git clone https://github.com/FiloSottile/mkcert && cd mkcert
go build -ldflags "-X main.Version=$(git describe --tags)"
sudo mv ./mkcert /usr/local/bin && cd ../
sudo chmod +x /usr/local/bin/mkcert
rm -Rf mkcert
- name: Install docker
run: |
brew install --cask docker
- name: Build and test
run: |
/bin/sh docker-images/export.sh --version latest --image-name ce-dev --dockerfile-path base
/bin/sh docker-images/export.sh --version latest --image-name ce-dev-controller --dockerfile-path controller
sudo chmod +x bin/run.js
/bin/sh templates/prebuild.sh