ci: test workflow and codecov config

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2023-02-19 21:57:26 +01:00
parent 3ef11caa59
commit bb62e49118
5 changed files with 53 additions and 15 deletions

View File

@ -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

26
.github/workflows/test.yml vendored Normal file
View File

@ -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

View File

@ -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 }}