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

Add input to specify the build url to use #12

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@ jobs:
strategy:
matrix:
os: [ ubuntu22_16cores_64gb ] #, macos-latest ]
build-url: [ "latest", "https://desktop.docker.com/linux/main/amd64/122432/docker-desktop-4.24.0-amd64.deb" ]
timeout-minutes: 20
steps:
- uses: actions/checkout@v4

- name: Start Desktop
uses: ./start
timeout-minutes: 5
with:
docker-desktop-build-url: ${{ matrix.build-url }}

- name: Docker Desktop version
run: docker version >> $GITHUB_STEP_SUMMARY

- name: Docker Desktop info
run: docker info
Expand Down
32 changes: 31 additions & 1 deletion start/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: "Docker Desktop action"
description: "Start Docker Desktop on a Github Action node"
inputs:
docker-desktop-build-url:
description: "Docker Desktop build url to use for installation"
required: false
default: "latest"
runs:
using: "composite"
steps:
Expand Down Expand Up @@ -81,6 +86,31 @@ runs:
/usr/bin/open /Applications/Docker.app --args --unattended --add-host-docker-internal-registry
echo "Docker starting..."

- name: Download appcast
if: runner.os == 'Linux'
shell: bash
run: |
curl https://desktop.docker.com/linux/main/amd64/appcast.xml -o appcast.xml

- name: Get Docker Desktop latest build url
if: runner.os == 'Linux' && inputs.docker-desktop-build-url == 'latest'
uses: mavrosxristoforos/[email protected]
id: get-latest-build-url
with:
xml-file: appcast.xml
xpath: //channel/link

- name: Define the build URL to use
if: runner.os == 'Linux'
id: get-build-url
shell: bash
run: |
buildUrl=${{ inputs.docker-desktop-build-url }}
if [[ "$buildUrl" == "latest" ]]; then
buildUrl=${{ steps.get-latest-build-url.outputs.info }}
fi
echo "build-url=$buildUrl" >> $GITHUB_OUTPUT

- name: Cache Docker Desktop packages
if: runner.os == 'Linux'
id: cache-docker-desktop
Expand All @@ -95,7 +125,7 @@ runs:
shell: bash
run: |
mkdir -p ~/.downloads
curl -sSL https://desktop.docker.com/linux/main/amd64/docker-desktop-4.25.0-amd64.deb > ~/.downloads/docker-desktop.deb
curl -sSL ${{ steps.get-build-url.outputs.build-url }} > ~/.downloads/docker-desktop.deb

- name: Check for CPU with VM support
if: runner.os == 'Linux'
Expand Down