| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- name: e2e-mac
- concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
- on:
- push:
- branches:
- - 'main'
- - 'e2e*'
- tags:
- - 'v*'
- pull_request:
- permissions:
- contents: read # to fetch code (actions/checkout)
- env:
- REPO_SLUG: "docker/compose-bin"
- jobs:
- e2e-mac:
- name: Build and test
- runs-on: ${{ matrix.os }}
- timeout-minutes: 55
- strategy:
- fail-fast: false
- matrix:
- os: [macos-latest-xl]
- # mode: [plugin, standalone]
- mode: [plugin]
- env:
- GO111MODULE: "on"
- steps:
- - uses: actions/checkout@v3
- - uses: actions/setup-go@v3
- with:
- go-version-file: go.mod
- cache: true
- check-latest: true
- # - name: Install and start Docker Desktop
- # uses: docker/desktop-action/[email protected]
- # if: ${{ contains(matrix.os, 'macos-latest') }}
- # Debugging why DD start fails, importing all steps from desktop-action/start
- - name: Get Date
- id: get-date
- run: |
- echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
- shell: bash
- - name: Get Docker app cache
- id: cache-docker-desktop-app
- uses: actions/cache@v3
- env:
- cache-name: cache-docker-desktop-app
- with:
- path: /Applications/Docker.app
- key: docker-desktop-app-mac-amd64-${{ steps.get-date.outputs.date }}
- - name: Get Docker install settings cache
- id: cache-docker-desktop-install-settings
- uses: actions/cache@v3
- env:
- cache-name: cache-docker-desktop-install-settings
- with:
- path: ./cache/desktopInstallSettings/
- key: docker-desktop-install-settings-mac-${{ steps.get-date.outputs.date }}
- - name: Block calls to segment.io
- id: redirect-segment
- shell: bash
- run: |
- echo '127.0.0.2 api.segment.io' | sudo tee -a /etc/hosts
- - name: Copy Desktop install settings in /Library
- if: steps.cache-docker-desktop-install-settings.outputs.cache-hit == 'true'
- shell: bash
- run: |
- echo "ls ./cache/desktopInstallSettings/"
- ls ./cache/desktopInstallSettings/
- sudo mkdir -p "/Library/Application Support/com.docker.docker"
- sudo cp ./cache/desktopInstallSettings/* "/Library/Application Support/com.docker.docker/"
- echo "/Library/Application Support/com.docker.docker/"
- ls "/Library/Application Support/com.docker.docker/"
- - name: Install Docker Desktop dmg
- if: steps.cache-docker-desktop-install-settings.outputs.cache-hit != 'true'
- shell: bash
- run: |
- sw_vers
- mkdir ./temp
- mkdir ./mount
- wget -q -O ./temp/DockerDesktop.dmg https://desktop.docker.com/mac/main/amd64/Docker.dmg
- /usr/bin/hdiutil attach -noverify ./temp/DockerDesktop.dmg -mountpoint ./mount/desktop -nobrowse
- echo "dmg mounted"
- sudo ./mount/desktop/Docker.app/Contents/MacOS/install --accept-license
- echo "dmg installed"
- echo "ls /Library/Application Support/com.docker.docker"
- ls "/Library/Application Support/com.docker.docker" || true
- mkdir -p ./cache/desktopInstallSettings
- cp "/Library/Application Support/com.docker.docker/"* ./cache/desktopInstallSettings/
- echo "ls ./cache/desktopInstallSettings/"
- ls ./cache/desktopInstallSettings/ || true
- /usr/bin/hdiutil detach ./mount/desktop
- echo "dmg unmounted"
- - name: Install Docker Desktop app
- shell: bash
- run: |
- sudo mkdir /Library/PrivilegedHelperTools
- sudo /Applications/Docker.app/Contents/MacOS/install config --user runner
- sudo /Applications/Docker.app/Contents/MacOS/install vmnetd
- echo "app installed"
- /usr/bin/open /Applications/Docker.app --args --unattended --add-host-docker-internal-registry
- echo "Docker starting..."
- - name: Wait for Docker to be up and running
- shell: bash
- run: |
- echo wait a minute
- sleep 30
- echo ...
- sleep 30
- echo ok
- - name: Upload diagnostics
- continue-on-error: true
- run: |
- /Applications/Docker.app/Contents/MacOS/com.docker.diagnose gather -upload
- - name: List Docker resources on machine
- run: |
- docker ps --all
- docker volume ls
- docker network ls
- docker image ls
- - name: Remove Docker resources on machine
- continue-on-error: true
- run: |
- docker kill $(docker ps -q)
- docker rm -f $(docker ps -aq)
- docker volume rm -f $(docker volume ls -q)
- docker ps --all
- - name: Unit tests
- run: make test
- - name: Build binaries
- run: |
- make
- - name: Check arch of go compose binary
- run: |
- file ./bin/build/docker-compose
- if: ${{ !contains(matrix.os, 'desktop-windows') }}
- -
- name: Test plugin mode
- if: ${{ matrix.mode == 'plugin' }}
- run: |
- make e2e-compose
- -
- name: Test standalone mode
- if: ${{ matrix.mode == 'standalone' }}
- run: |
- make e2e-compose-standalone
|