mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-13 14:55:28 +00:00
chore: combine test coverage for core tests
This commit is contained in:
9
.github/workflows/build.yml
vendored
9
.github/workflows/build.yml
vendored
@@ -57,8 +57,6 @@ jobs:
|
||||
with:
|
||||
core_cache_key: ${{ needs.core.outputs.cache_key }}
|
||||
core_cache_path: ${{ needs.core.outputs.cache_path }}
|
||||
secrets:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
core-integration-test:
|
||||
needs: core
|
||||
@@ -66,6 +64,13 @@ jobs:
|
||||
with:
|
||||
core_cache_key: ${{ needs.core.outputs.cache_key }}
|
||||
core_cache_path: ${{ needs.core.outputs.cache_path }}
|
||||
|
||||
core-coverage:
|
||||
needs: [ core-unit-test, core-integration-test ]
|
||||
uses: ./.github/workflows/core-coverage.yml
|
||||
with:
|
||||
unit_test_report: ${{ needs.core-unit-test.outputs.unit_test_report }}
|
||||
integration_test_report: ${{ needs.core-integration-test.outputs.integration_test_report }}
|
||||
secrets:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
|
38
.github/workflows/core-coverage.yml
vendored
Normal file
38
.github/workflows/core-coverage.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: Upload coverage
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
unit_test_report:
|
||||
required: true
|
||||
type: boolean
|
||||
integration_test_report:
|
||||
required: true
|
||||
type: boolean
|
||||
secrets:
|
||||
CODECOV_TOKEN:
|
||||
required: true
|
||||
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: tmp/coverage/unit
|
||||
name: unit-coverage
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: tmp/coverage/integration
|
||||
name: integration-coverage
|
||||
- name: merge coverages
|
||||
if: ${{ unit_test_report == 'true' && integration_test_report == 'true' }}
|
||||
run: make core_coverage_reports
|
||||
- name: publish coverage
|
||||
if: ${{ unit_test_report == 'true' && integration_test_report == 'true' }}
|
||||
uses: codecov/codecov-action@v5.4.0
|
||||
with:
|
||||
file: full-profile.cov
|
||||
name: core-integration-tests-postgres
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
21
.github/workflows/core-integration-test.yml
vendored
21
.github/workflows/core-integration-test.yml
vendored
@@ -9,9 +9,10 @@ on:
|
||||
core_cache_path:
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
CODECOV_TOKEN:
|
||||
required: true
|
||||
outputs:
|
||||
integration_test_report:
|
||||
value: ${{ steps.cache.outputs.cache-hit != 'true' }}
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
postgres:
|
||||
@@ -74,6 +75,12 @@ jobs:
|
||||
env:
|
||||
ZITADEL_MASTERKEY: MasterkeyNeedsToHave32Characters
|
||||
run: make core_integration_test
|
||||
-
|
||||
uses: actions/upload-artifact@v4
|
||||
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
|
||||
with:
|
||||
name: integration-coverage
|
||||
path: tmp/coverage/integration
|
||||
-
|
||||
name: upload server logs
|
||||
if: always()
|
||||
@@ -83,14 +90,6 @@ jobs:
|
||||
path: |
|
||||
tmp/zitadel.log
|
||||
tmp/race.log.*
|
||||
-
|
||||
name: publish coverage
|
||||
uses: codecov/codecov-action@v4.3.0
|
||||
with:
|
||||
file: profile.cov
|
||||
name: core-integration-tests-postgres
|
||||
flags: core-integration-tests-postgres
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
-
|
||||
uses: actions/cache/save@v4
|
||||
name: cache results
|
||||
|
19
.github/workflows/core-unit-test.yml
vendored
19
.github/workflows/core-unit-test.yml
vendored
@@ -12,9 +12,10 @@ on:
|
||||
crdb_version:
|
||||
required: false
|
||||
type: string
|
||||
secrets:
|
||||
CODECOV_TOKEN:
|
||||
required: true
|
||||
outputs:
|
||||
unit_test_report:
|
||||
value: ${{ steps.cache.outputs.cache-hit != 'true' }}
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
test:
|
||||
@@ -54,14 +55,12 @@ jobs:
|
||||
name: test
|
||||
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
|
||||
run: make core_unit_test
|
||||
-
|
||||
name: publish coverage
|
||||
uses: codecov/codecov-action@v4.3.0
|
||||
-
|
||||
uses: actions/upload-artifact@v4
|
||||
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
|
||||
with:
|
||||
file: profile.cov
|
||||
name: core-unit-tests
|
||||
flags: core-unit-tests
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
name: unit-coverage
|
||||
path: tmp/coverage/unit
|
||||
-
|
||||
uses: actions/cache/save@v4
|
||||
name: cache results
|
||||
|
Reference in New Issue
Block a user