diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1fe8291..5ba0867 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,8 +26,9 @@ jobs: uses: actions/checkout@v4 - name: Test - uses: docker/bake-action@v5 + uses: docker/bake-action@v6 with: + source: . targets: test - name: Upload coverage diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 1a6a7ca..55b6b4e 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -14,21 +14,24 @@ on: - 'master' - 'releases/v*' pull_request: + paths-ignore: + - '.github/upx-releases.json' jobs: prepare: runs-on: ubuntu-latest outputs: - targets: ${{ steps.targets.outputs.matrix }} + targets: ${{ steps.generate.outputs.targets }} steps: - name: Checkout uses: actions/checkout@v4 - - name: Targets matrix - id: targets - run: | - echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT + name: List targets + id: generate + uses: docker/bake-action/subaction/list-targets@v6 + with: + target: validate validate: runs-on: ubuntu-latest @@ -39,11 +42,8 @@ jobs: matrix: target: ${{ fromJson(needs.prepare.outputs.targets) }} steps: - - - name: Checkout - uses: actions/checkout@v4 - name: Validate - uses: docker/bake-action@v5 + uses: docker/bake-action@v6 with: targets: ${{ matrix.target }} diff --git a/docker-bake.hcl b/docker-bake.hcl index 2942972..40ae813 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,3 +1,9 @@ +target "_common" { + args = { + BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1 + } +} + group "default" { targets = ["build"] } @@ -17,6 +23,7 @@ target "build" { } target "build-validate" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "build-validate" output = ["type=cacheonly"] @@ -41,6 +48,7 @@ target "vendor-update" { } target "vendor-validate" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "vendor-validate" output = ["type=cacheonly"]