mirror of
https://github.com/docker/bake-action.git
synced 2026-03-11 02:47:49 +01:00
Merge pull request #370 from crazy-max/remove-list-targets
remove list-targets subaction
This commit is contained in:
50
.github/workflows/ci-subaction.yml
vendored
50
.github/workflows/ci-subaction.yml
vendored
@@ -25,56 +25,6 @@ on:
|
||||
- 'test/**'
|
||||
|
||||
jobs:
|
||||
list-targets:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
-
|
||||
testdir: group
|
||||
expected: >
|
||||
["t1","t2"]
|
||||
-
|
||||
testdir: group-matrix
|
||||
target: validate
|
||||
expected: >
|
||||
["lint-default","lint-labs","lint-nydus","lint-proto","lint-yaml","validate-doctoc","validate-vendor"]
|
||||
-
|
||||
testdir: multi-files
|
||||
files: |
|
||||
docker-bake.json
|
||||
docker-bake.hcl
|
||||
expected: >
|
||||
["v1-tag","v2-tag"]
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Matrix gen
|
||||
id: gen
|
||||
uses: ./subaction/list-targets
|
||||
with:
|
||||
workdir: ./test/${{ matrix.testdir }}
|
||||
files: ${{ matrix.files }}
|
||||
target: ${{ matrix.target }}
|
||||
-
|
||||
name: Check output
|
||||
uses: actions/github-script@v8
|
||||
env:
|
||||
INPUT_TARGETS: ${{ steps.gen.outputs.targets }}
|
||||
INPUT_EXPECTED: ${{ matrix.expected }}
|
||||
with:
|
||||
script: |
|
||||
const targets = JSON.stringify(JSON.parse(core.getInput('targets')));
|
||||
const expected = JSON.stringify(JSON.parse(core.getInput('expected')));
|
||||
if (targets !== expected) {
|
||||
throw new Error(`Targets do not match expected values: ${targets} != ${expected}`);
|
||||
} else {
|
||||
core.info(`✅`);
|
||||
}
|
||||
|
||||
matrix:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
|
||||
6
.github/workflows/validate.yml
vendored
6
.github/workflows/validate.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
targets: ${{ steps.generate.outputs.targets }}
|
||||
matrix: ${{ steps.generate.outputs.matrix }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
-
|
||||
name: List targets
|
||||
id: generate
|
||||
uses: ./subaction/list-targets
|
||||
uses: ./subaction/matrix
|
||||
with:
|
||||
target: validate
|
||||
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target: ${{ fromJson(needs.prepare.outputs.targets) }}
|
||||
include: ${{ fromJson(needs.prepare.outputs.matrix) }}
|
||||
steps:
|
||||
-
|
||||
name: Validate
|
||||
|
||||
Reference in New Issue
Block a user