name: Integration test core on: workflow_call: inputs: core_cache_key: required: true type: string core_cache_path: required: true type: string secrets: CODECOV_TOKEN: required: true jobs: postgres: runs-on: group: zitadel-public services: postgres: image: postgres ports: - 5432:5432 env: POSTGRES_USER: zitadel PGUSER: zitadel POSTGRES_DB: zitadel POSTGRES_HOST_AUTH_METHOD: trust options: >- --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 --health-start-period 10s cache: image: redis:latest ports: - 6379:6379 steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version-file: 'go.mod' - uses: actions/cache/restore@v4 timeout-minutes: 1 name: restore core id: restore-core with: path: ${{ inputs.core_cache_path }} key: ${{ inputs.core_cache_key }} fail-on-cache-miss: true - id: go-cache-path name: set cache path run: echo "GO_CACHE_PATH=$(go env GOCACHE)" >> $GITHUB_OUTPUT - uses: actions/cache/restore@v4 id: cache timeout-minutes: 1 continue-on-error: true name: restore previous results with: key: integration-test-postgres-${{ inputs.core_cache_key }} restore-keys: | integration-test-postgres-core- path: ${{ steps.go-cache-path.outputs.GO_CACHE_PATH }} - name: test if: ${{ steps.cache.outputs.cache-hit != 'true' }} env: ZITADEL_MASTERKEY: MasterkeyNeedsToHave32Characters run: make core_integration_test - name: upload server logs if: always() uses: actions/upload-artifact@v4 with: name: integration-test-server-logs 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 if: ${{ steps.cache.outputs.cache-hit != 'true' }} with: key: integration-test-postgres-${{ inputs.core_cache_key }} path: ${{ steps.go-cache-path.outputs.GO_CACHE_PATH }}