ci: update bake-action to v6

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2025-01-10 16:58:54 +01:00 committed by Guillaume Lours
parent e81de103db
commit 083f676214
2 changed files with 33 additions and 39 deletions

View File

@ -76,9 +76,6 @@ jobs:
run: | run: |
platform=${{ matrix.platform }} platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
-
name: Checkout
uses: actions/checkout@v4
- -
name: Set up QEMU name: Set up QEMU
uses: docker/setup-qemu-action@v3 uses: docker/setup-qemu-action@v3
@ -87,7 +84,7 @@ jobs:
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- -
name: Build name: Build
uses: docker/bake-action@v5 uses: docker/bake-action@v6
with: with:
targets: release targets: release
set: | set: |
@ -105,15 +102,12 @@ jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
-
name: Checkout
uses: actions/checkout@v4
- -
name: Set up Docker Buildx name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- -
name: Test name: Test
uses: docker/bake-action@v5 uses: docker/bake-action@v6
with: with:
targets: test targets: test
set: | set: |
@ -149,9 +143,10 @@ jobs:
mode=${{ matrix.mode }} mode=${{ matrix.mode }}
engine=${{ matrix.engine }} engine=${{ matrix.engine }}
echo "MODE_ENGINE_PAIR=${mode}-${engine}" >> $GITHUB_ENV echo "MODE_ENGINE_PAIR=${mode}-${engine}" >> $GITHUB_ENV
-
name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install Docker ${{ matrix.engine }} - name: Install Docker ${{ matrix.engine }}
run: | run: |
sudo systemctl stop docker.service sudo systemctl stop docker.service
@ -159,22 +154,24 @@ jobs:
sudo apt-get install curl sudo apt-get install curl
curl -fsSL https://test.docker.com -o get-docker.sh curl -fsSL https://test.docker.com -o get-docker.sh
sudo sh ./get-docker.sh --version ${{ matrix.engine }} sudo sh ./get-docker.sh --version ${{ matrix.engine }}
- name: Check Docker Version - name: Check Docker Version
run: docker --version run: docker --version
-
name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
-
name: Set up Go - name: Set up Go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version-file: 'go.mod' go-version-file: 'go.mod'
check-latest: true check-latest: true
cache: true cache: true
-
name: Build - name: Build
uses: docker/bake-action@v5 uses: docker/bake-action@v6
with: with:
source: .
targets: binary-with-coverage targets: binary-with-coverage
set: | set: |
*.cache-from=type=gha,scope=binary-linux-amd64 *.cache-from=type=gha,scope=binary-linux-amd64
@ -182,37 +179,37 @@ jobs:
*.cache-to=type=gha,scope=binary-e2e-${{ matrix.mode }},mode=max *.cache-to=type=gha,scope=binary-e2e-${{ matrix.mode }},mode=max
env: env:
BUILD_TAGS: e2e BUILD_TAGS: e2e
-
name: Setup tmate session - name: Setup tmate session
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }} if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
uses: mxschmitt/action-tmate@8b4e4ac71822ed7e0ad5fb3d1c33483e9e8fb270 # v3.11 uses: mxschmitt/action-tmate@8b4e4ac71822ed7e0ad5fb3d1c33483e9e8fb270 # v3.11
with: with:
limit-access-to-actor: true limit-access-to-actor: true
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
-
name: Test plugin mode - name: Test plugin mode
if: ${{ matrix.mode == 'plugin' }} if: ${{ matrix.mode == 'plugin' }}
run: | run: |
rm -rf ./bin/coverage/e2e rm -rf ./bin/coverage/e2e
mkdir -p ./bin/coverage/e2e mkdir -p ./bin/coverage/e2e
make e2e-compose GOCOVERDIR=bin/coverage/e2e TEST_FLAGS="-v" make e2e-compose GOCOVERDIR=bin/coverage/e2e TEST_FLAGS="-v"
-
name: Gather coverage data - name: Gather coverage data
if: ${{ matrix.mode == 'plugin' }} if: ${{ matrix.mode == 'plugin' }}
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: coverage-data-e2e-${{ env.MODE_ENGINE_PAIR }} name: coverage-data-e2e-${{ env.MODE_ENGINE_PAIR }}
path: bin/coverage/e2e/ path: bin/coverage/e2e/
if-no-files-found: error if-no-files-found: error
-
name: Test standalone mode - name: Test standalone mode
if: ${{ matrix.mode == 'standalone' }} if: ${{ matrix.mode == 'standalone' }}
run: | run: |
rm -f /usr/local/bin/docker-compose rm -f /usr/local/bin/docker-compose
cp bin/build/docker-compose /usr/local/bin cp bin/build/docker-compose /usr/local/bin
make e2e-compose-standalone make e2e-compose-standalone
-
name: e2e Test Summary - name: e2e Test Summary
uses: test-summary/action@v2 uses: test-summary/action@v2
with: with:
paths: /tmp/report/report.xml paths: /tmp/report/report.xml

View File

@ -80,8 +80,12 @@ jobs:
digest: ${{ fromJSON(steps.bake.outputs.metadata).image-cross['containerimage.digest'] }} digest: ${{ fromJSON(steps.bake.outputs.metadata).image-cross['containerimage.digest'] }}
steps: steps:
- -
name: Checkout name: Login to DockerHub
uses: actions/checkout@v4 if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERPUBLICBOT_USERNAME }}
password: ${{ secrets.DOCKERPUBLICBOT_WRITE_PAT }}
- -
name: Set up QEMU name: Set up QEMU
uses: docker/setup-qemu-action@v3 uses: docker/setup-qemu-action@v3
@ -99,13 +103,6 @@ jobs:
type=ref,event=tag type=ref,event=tag
type=edge type=edge
bake-target: meta-helper bake-target: meta-helper
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERPUBLICBOT_USERNAME }}
password: ${{ secrets.DOCKERPUBLICBOT_WRITE_PAT }}
- -
name: Build and push image name: Build and push image
uses: docker/bake-action@v5 uses: docker/bake-action@v5
@ -113,14 +110,14 @@ jobs:
with: with:
files: | files: |
./docker-bake.hcl ./docker-bake.hcl
${{ steps.meta.outputs.bake-file }} cwd://${{ steps.meta.outputs.bake-file }}
targets: image-cross targets: image-cross
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
sbom: true
provenance: mode=max
set: | set: |
*.cache-from=type=gha,scope=bin-image *.cache-from=type=gha,scope=bin-image
*.cache-to=type=gha,scope=bin-image,mode=max *.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: desktop-edge-test:
runs-on: ubuntu-latest runs-on: ubuntu-latest