From 611b62c8d77d52a52a14a2edfb676580c0b3b2e8 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Thu, 2 Mar 2023 14:19:12 +0100 Subject: [PATCH] ci: test and validate workflows --- .github/workflows/test.yml | 26 +++++++++++++++++++++ .github/workflows/validate.yml | 41 ++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 .github/workflows/test.yml create mode 100644 .github/workflows/validate.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..80a52e3 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,26 @@ +name: test + +on: + push: + branches: + - 'master' + - 'releases/v*' + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Test + uses: docker/bake-action@v2 + with: + targets: test + - + name: Upload coverage + uses: codecov/codecov-action@v3 + with: + file: ./coverage/clover.xml diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..33fc0db --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,41 @@ +name: validate + +on: + push: + branches: + - 'master' + - 'releases/v*' + pull_request: + +jobs: + prepare: + runs-on: ubuntu-latest + outputs: + targets: ${{ steps.targets.outputs.matrix }} + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Targets 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 }}