From bb62e49118e5730c60750749dfa25a693a043f83 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Sun, 19 Feb 2023 21:57:26 +0100 Subject: [PATCH] ci: test workflow and codecov config Signed-off-by: CrazyMax --- .github/workflows/ci.yml | 12 +----------- .github/workflows/test.yml | 26 ++++++++++++++++++++++++++ .github/workflows/validate.yml | 25 +++++++++++++++++++++---- README.md | 2 ++ codecov.yml | 3 +++ 5 files changed, 53 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/test.yml create mode 100644 codecov.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4803f81..5b856e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: ci on: schedule: - - cron: '0 10 * * *' # everyday at 10am + - cron: '0 10 * * *' push: branches: - 'master' @@ -10,9 +10,6 @@ on: tags: - 'v*' pull_request: - branches: - - 'master' - - 'releases/v*' jobs: main: @@ -40,9 +37,6 @@ jobs: - name: Available platforms run: echo ${{ steps.qemu.outputs.platforms }} - - - name: Dump context - uses: crazy-max/ghaction-dump-context@v1 error: runs-on: ubuntu-latest @@ -67,7 +61,3 @@ jobs: echo "::error::Should have failed" exit 1 fi - - - name: Dump context - if: always() - uses: crazy-max/ghaction-dump-context@v1 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 index 1484c60..33fc0db 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -6,13 +6,30 @@ on: - 'master' - 'releases/v*' pull_request: - branches: - - 'master' - - 'releases/v*' 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 @@ -21,4 +38,4 @@ jobs: name: Validate uses: docker/bake-action@v2 with: - targets: validate + targets: ${{ matrix.target }} diff --git a/README.md b/README.md index 690ffe0..00ed615 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ [![GitHub release](https://img.shields.io/github/release/docker/setup-qemu-action.svg?style=flat-square)](https://github.com/docker/setup-qemu-action/releases/latest) [![GitHub marketplace](https://img.shields.io/badge/marketplace-docker--setup--qemu-blue?logo=github&style=flat-square)](https://github.com/marketplace/actions/docker-setup-qemu) [![CI workflow](https://img.shields.io/github/actions/workflow/status/docker/setup-qemu-action/ci.yml?branch=master&label=ci&logo=github&style=flat-square)](https://github.com/docker/setup-qemu-action/actions?workflow=ci) +[![Test workflow](https://img.shields.io/github/actions/workflow/status/docker/setup-qemu-action/test.yml?branch=master&label=test&logo=github&style=flat-square)](https://github.com/docker/setup-qemu-action/actions?workflow=test) +[![Codecov](https://img.shields.io/codecov/c/github/docker/setup-qemu-action?logo=codecov&style=flat-square)](https://codecov.io/gh/docker/setup-qemu-action) ## About diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..dc46984 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,3 @@ +comment: false +github_checks: + annotations: false