chore: combine test coverage for core tests

This commit is contained in:
Stefan Benz
2025-07-07 18:11:38 +02:00
parent f606e46822
commit 4974e31faa
2 changed files with 12 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
name: Integration test core name: Integration test core
on: on:
workflow_call: workflow_call:
inputs: inputs:
core_cache_key: core_cache_key:
@@ -11,10 +11,12 @@ on:
type: string type: string
outputs: outputs:
integration_test_report: integration_test_report:
value: ${{ steps.cache.outputs.cache-hit != 'true' }} value: ${{ jobs.postgres.outputs.integration_test_report }}
jobs: jobs:
postgres: postgres:
outputs:
integration_test_report: ${{ steps.cache.outputs.cache-hit != 'true' }}
runs-on: runs-on:
group: zitadel-public group: zitadel-public
services: services:
@@ -38,13 +40,13 @@ jobs:
ports: ports:
- 6379:6379 - 6379:6379
steps: steps:
- -
uses: actions/checkout@v4 uses: actions/checkout@v4
- -
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version-file: 'go.mod' go-version-file: 'go.mod'
- -
uses: actions/cache/restore@v4 uses: actions/cache/restore@v4
timeout-minutes: 1 timeout-minutes: 1
name: restore core name: restore core
@@ -57,7 +59,7 @@ jobs:
id: go-cache-path id: go-cache-path
name: set cache path name: set cache path
run: echo "GO_CACHE_PATH=$(go env GOCACHE)" >> $GITHUB_OUTPUT run: echo "GO_CACHE_PATH=$(go env GOCACHE)" >> $GITHUB_OUTPUT
- -
uses: actions/cache/restore@v4 uses: actions/cache/restore@v4
id: cache id: cache
timeout-minutes: 1 timeout-minutes: 1
@@ -68,7 +70,7 @@ jobs:
restore-keys: | restore-keys: |
integration-test-postgres-core- integration-test-postgres-core-
path: ${{ steps.go-cache-path.outputs.GO_CACHE_PATH }} path: ${{ steps.go-cache-path.outputs.GO_CACHE_PATH }}
- -
name: test name: test
if: ${{ steps.cache.outputs.cache-hit != 'true' }} if: ${{ steps.cache.outputs.cache-hit != 'true' }}
env: env:
@@ -89,7 +91,7 @@ jobs:
path: | path: |
tmp/zitadel.log tmp/zitadel.log
tmp/race.log.* tmp/race.log.*
- -
uses: actions/cache/save@v4 uses: actions/cache/save@v4
name: cache results name: cache results
if: ${{ steps.cache.outputs.cache-hit != 'true' }} if: ${{ steps.cache.outputs.cache-hit != 'true' }}

View File

@@ -14,10 +14,12 @@ on:
type: string type: string
outputs: outputs:
unit_test_report: unit_test_report:
value: ${{ steps.cache.outputs.cache-hit != 'true' }} value: ${{ jobs.test.outputs.unit_test_report }}
jobs: jobs:
test: test:
outputs:
unit_test_report: ${{ steps.cache.outputs.cache-hit != 'true' }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- -