Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .github/subaction-list-targets.png
Binary file not shown.
50 changes: 0 additions & 50 deletions .github/workflows/ci-subaction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:
prepare:
runs-on: ubuntu-latest
outputs:
targets: ${{ steps.generate.outputs.targets }}
matrix: ${{ steps.generate.outputs.matrix }}
steps:
-
name: Checkout
uses: actions/checkout@v6
-
name: List targets
id: generate
uses: ./subaction/list-targets
uses: ./subaction/matrix
with:
target: validate

Expand All @@ -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
Expand Down
86 changes: 0 additions & 86 deletions subaction/list-targets/README.md

This file was deleted.

72 changes: 0 additions & 72 deletions subaction/list-targets/action.yml

This file was deleted.

Loading