From a89868cdc57f4be28501b4d39dc19374324fd8b8 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Sun, 26 Mar 2023 14:26:31 +0200 Subject: [PATCH] ci: move validate to a dedicated workflow Signed-off-by: CrazyMax --- .github/workflows/test.yml | 19 --------------- .github/workflows/validate.yml | 43 ++++++++++++++++++++++++++++++++++ README.md | 1 + 3 files changed, 44 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/validate.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 01eb4fe..803a8b3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,25 +10,6 @@ on: - '.github/*-releases.json' jobs: - validate: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - target: - - lint - - vendor-validate - - license-validate - steps: - - - name: Checkout - uses: actions/checkout@v3 - - - name: Validate - uses: docker/bake-action@v2 - with: - targets: ${{ matrix.target }} - test: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..3adac25 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,43 @@ +name: validate + +on: + workflow_dispatch: + push: + branches: + - 'main' + pull_request: + paths-ignore: + - '.github/*-releases.json' + +jobs: + prepare: + runs-on: ubuntu-20.04 + outputs: + targets: ${{ steps.targets.outputs.matrix }} + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Matrix + id: targets + run: | + echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT + + validate: + runs-on: ubuntu-latest + needs: + - prepare + strategy: + fail-fast: false + matrix: + target: ${{ fromJson(needs.prepare.outputs.targets) }} + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Validate + uses: docker/bake-action@v2 + with: + targets: ${{ matrix.target }} diff --git a/README.md b/README.md index c1d3a58..9ec2f42 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Downloads](https://img.shields.io/npm/dw/@docker/actions-toolkit?logo=npm&style=flat-square)](https://www.npmjs.com/package/@docker/actions-toolkit) [![Build workflow](https://img.shields.io/github/actions/workflow/status/docker/actions-toolkit/build.yml?label=build&logo=github&style=flat-square)](https://github.com/docker/actions-toolkit/actions?workflow=build) [![Test workflow](https://img.shields.io/github/actions/workflow/status/docker/actions-toolkit/test.yml?label=test&logo=github&style=flat-square)](https://github.com/docker/actions-toolkit/actions?workflow=test) +[![Validate workflow](https://img.shields.io/github/actions/workflow/status/docker/actions-toolkit/validate.yml?label=validate&logo=github&style=flat-square)](https://github.com/docker/actions-toolkit/actions?workflow=validate) [![Codecov](https://img.shields.io/codecov/c/github/docker/actions-toolkit?logo=codecov&style=flat-square)](https://codecov.io/gh/docker/actions-toolkit) # Actions Toolkit