Skip to content

Commit

Permalink
Add input to specify the build url to use (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
benja-M-1 authored Nov 10, 2023
1 parent 8b8d6b7 commit bf3d9d0
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
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

0 comments on commit bf3d9d0

Please sign in to comment.