diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d571cf7..21790e5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,6 +12,7 @@ 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 @@ -19,6 +20,11 @@ jobs: - 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 diff --git a/start/action.yml b/start/action.yml index 64375da..e67a10f 100644 --- a/start/action.yml +++ b/start/action.yml @@ -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: @@ -81,6 +86,27 @@ 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/get-xml-info@1.1.1 + id: get-latest-build-url + with: + xml-file: appcast.xml + xpath: //channel/link + + - name: Define the build URL to use + if: runner.os == 'Linux' + shell: bash + id: get-build-url + run: + echo "info=${{ inputs.docker-desktop-build-url || steps.get-latest-build-url.outputs.info }}" >> $GITHUB_OUTPUT + - name: Cache Docker Desktop packages if: runner.os == 'Linux' id: cache-docker-desktop @@ -95,7 +121,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.info }} > ~/.downloads/docker-desktop.deb - name: Check for CPU with VM support if: runner.os == 'Linux'