ci: use bin-image edge tag directly for e2e tests #1463
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: merge | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: read # to fetch code (actions/checkout) | |
| env: | |
| REPO_SLUG: "docker/compose-bin" | |
| jobs: | |
| e2e: | |
| name: Build and test | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [desktop-windows, desktop-macos, desktop-m1] | |
| # mode: [plugin, standalone] | |
| mode: [plugin] | |
| env: | |
| GO111MODULE: "on" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: '.go-version' | |
| cache: true | |
| check-latest: true | |
| - 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 | |
| bin-image-prepare: | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| repo-slug: ${{ env.REPO_SLUG }} | |
| steps: | |
| # FIXME: can't use env object in reusable workflow inputs: https://github.com/orgs/community/discussions/26671 | |
| - run: echo "Exposing env vars for reusable workflow" | |
| bin-image: | |
| uses: docker/github-builder/.github/workflows/bake.yml@v1 | |
| needs: | |
| - bin-image-prepare | |
| permissions: | |
| contents: read # same as global permission | |
| id-token: write # for signing attestation(s) with GitHub OIDC Token | |
| with: | |
| runner: amd64 | |
| target: image-cross | |
| cache: true | |
| cache-scope: bin-image | |
| output: image | |
| push: ${{ github.event_name != 'pull_request' }} | |
| sbom: true | |
| set-meta-labels: true | |
| meta-images: | | |
| ${{ needs.bin-image-prepare.outputs.repo-slug }} | |
| meta-tags: | | |
| type=ref,event=tag | |
| type=edge | |
| meta-bake-target: meta-helper | |
| secrets: | |
| registry-auths: | | |
| - registry: docker.io | |
| username: ${{ secrets.DOCKERPUBLICBOT_USERNAME }} | |
| password: ${{ secrets.DOCKERPUBLICBOT_WRITE_PAT }} | |
| desktop-edge-test: | |
| runs-on: ubuntu-latest | |
| needs: bin-image | |
| steps: | |
| - | |
| name: Generate Token | |
| id: generate_token | |
| uses: actions/create-github-app-token@v1 | |
| with: | |
| app-id: ${{ vars.DOCKERDESKTOP_APP_ID }} | |
| private-key: ${{ secrets.DOCKERDESKTOP_APP_PRIVATEKEY }} | |
| owner: docker | |
| repositories: | | |
| ${{ secrets.DOCKERDESKTOP_REPO }} | |
| - | |
| name: Trigger Docker Desktop e2e with edge version | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ steps.generate_token.outputs.token }} | |
| script: | | |
| await github.rest.actions.createWorkflowDispatch({ | |
| owner: 'docker', | |
| repo: '${{ secrets.DOCKERDESKTOP_REPO }}', | |
| workflow_id: 'compose-edge-integration.yml', | |
| ref: 'main', | |
| inputs: { | |
| "image-tag": "${{ env.REPO_SLUG }}:edge" | |
| } | |
| }) |