| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- name: merge
- concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
- on:
- push:
- branches:
- - 'v2'
- 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@v3
- - uses: actions/setup-go@v3
- with:
- go-version-file: go.mod
- 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:
- runs-on: ubuntu-22.04
- outputs:
- tags: ${{ steps.meta.outputs.tags }}
- steps:
- -
- name: Checkout
- uses: actions/checkout@v3
- -
- name: Set up QEMU
- uses: docker/setup-qemu-action@v2
- -
- name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v2
- -
- name: Docker meta
- id: meta
- uses: docker/metadata-action@v4
- with:
- images: |
- ${{ env.REPO_SLUG }}
- tags: |
- type=ref,event=tag
- type=edge
- bake-target: meta-helper
- -
- name: Login to DockerHub
- if: github.event_name != 'pull_request'
- uses: docker/login-action@v2
- with:
- username: ${{ secrets.DOCKERPUBLICBOT_USERNAME }}
- password: ${{ secrets.DOCKERPUBLICBOT_WRITE_PAT }}
- -
- name: Build and push image
- uses: docker/bake-action@v2
- id: bake
- with:
- files: |
- ./docker-bake.hcl
- ${{ steps.meta.outputs.bake-file }}
- targets: image-cross
- push: ${{ github.event_name != 'pull_request' }}
- set: |
- *.cache-from=type=gha,scope=bin-image
- *.cache-to=type=gha,scope=bin-image,mode=max
- *.attest=type=sbom
- *.attest=type=provenance,mode=max,builder-id=https://github.com/${{ env.GITHUB_REPOSITORY }}/actions/runs/${{ env.GITHUB_RUN_ID }}
- desktop-edge-test:
- runs-on: ubuntu-latest
- needs: bin-image
- steps:
- -
- name: Generate Token
- id: generate_token
- uses: tibdex/github-app-token@v1
- with:
- app_id: ${{ variables.DOCKERDESKTOP_APPID }}
- private_key: ${{ secrets.DOCKERDESKTOP_APP_PRIVATEKEY }}
- -
- name: Trigger Docker Desktop e2e with edge version
- uses: actions/github-script@v6
- with:
- github-token: ${{ steps.generate_token.outputs.token }}
- script: |
- await github.rest.actions.createWorkflowDispatch({
- owner: 'docker',
- repo: 'pinata',
- workflow_id: 'compose-edge-integration.yml',
- ref: 'compose-edge-integration'
- inputs: {
- "image-tag": '${{ fromJSON(needs.bin-image.bake.outputs.metadata).image-cross["containerimage.digest"] }}'
- }
- })
|