Skip to content

Commit da2cb99

Browse files
authored
Merge pull request #63 from crazy-max/bake-v6
ci: update bake-action to v6
2 parents a33364e + fee93a5 commit da2cb99

File tree

2 files changed

+36
-9
lines changed

2 files changed

+36
-9
lines changed

.github/workflows/test.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,42 @@ on:
1010
pull_request:
1111

1212
jobs:
13-
validate:
13+
prepare-validate:
1414
runs-on: ubuntu-latest
15+
outputs:
16+
targets: ${{ steps.generate.outputs.targets }}
1517
steps:
1618
-
1719
name: Checkout
1820
uses: actions/checkout@v4
1921
-
20-
name: Run
21-
uses: docker/bake-action@v5
22+
name: List targets
23+
id: generate
24+
uses: docker/bake-action/subaction/list-targets@v6
2225
with:
23-
targets: validate
26+
target: validate
2427

25-
test:
28+
validate:
2629
runs-on: ubuntu-latest
30+
needs:
31+
- prepare-validate
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
target: ${{ fromJson(needs.prepare-validate.outputs.targets) }}
2736
steps:
2837
-
29-
name: Checkout
30-
uses: actions/checkout@v4
38+
name: Validate
39+
uses: docker/bake-action@v6
40+
with:
41+
targets: ${{ matrix.target }}
42+
43+
test:
44+
runs-on: ubuntu-latest
45+
steps:
3146
-
32-
name: Run
33-
uses: docker/bake-action@v5
47+
name: Test
48+
uses: docker/bake-action@v6
3449
with:
3550
targets: test
3651
-

docker-bake.hcl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
target "_common" {
16+
args = {
17+
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
18+
}
19+
}
20+
1521
group "default" {
1622
targets = ["test"]
1723
}
@@ -21,31 +27,37 @@ group "validate" {
2127
}
2228

2329
target "lint" {
30+
inherits = ["_common"]
2431
target = "lint"
2532
output = ["type=cacheonly"]
2633
}
2734

2835
target "vendor-validate" {
36+
inherits = ["_common"]
2937
target = "vendor-validate"
3038
output = ["type=cacheonly"]
3139
}
3240

3341
target "vendor-update" {
42+
inherits = ["_common"]
3443
target = "vendor-update"
3544
output = ["."]
3645
}
3746

3847
target "test" {
48+
inherits = ["_common"]
3949
target = "test-coverage"
4050
output = ["."]
4151
}
4252

4353
target "license-validate" {
54+
inherits = ["_common"]
4455
target = "license-validate"
4556
output = ["type=cacheonly"]
4657
}
4758

4859
target "license-update" {
60+
inherits = ["_common"]
4961
target = "license-update"
5062
output = ["."]
5163
}

0 commit comments

Comments
 (0)