producer-gin: startup/shutdown logs now respect LOG_LEVEL #42
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: crossplane-dapr-ci | |
| on: | |
| push: | |
| paths: | |
| - 'crossplane-dapr/**' | |
| - '.github/workflows/crossplane-dapr.yml' | |
| pull_request: | |
| paths: | |
| - 'crossplane-dapr/**' | |
| - '.github/workflows/crossplane-dapr.yml' | |
| workflow_dispatch: | |
| jobs: | |
| shift-left: | |
| runs-on: ubuntu-latest | |
| env: | |
| PUSHGATEWAY_URL: ${{ secrets.PUSHGATEWAY_URL }} | |
| defaults: | |
| run: | |
| working-directory: crossplane-dapr | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| cache: gradle | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.23.x' | |
| cache-dependency-path: | | |
| crossplane-dapr/producer-gin/go.sum | |
| crossplane-dapr/consumer-gin/go.sum | |
| - name: Make Gradle executable | |
| run: chmod +x gradlew | |
| - name: Unit tests (Ktor + Spring Boot + Gin) | |
| run: make unit-test | |
| - name: Static quality gates | |
| run: ./gradlew ktlintCheck detekt | |
| - name: Integration tests (Ktor + Spring Boot + Gin) | |
| run: make integration-test | |
| - name: Contract tests (Ktor + Spring Boot + Gin) | |
| run: make contract-test | |
| - name: Coverage gate | |
| run: ./gradlew koverVerify | |
| - name: Build stack/service-separated test pyramid metrics files | |
| run: make test-pyramid-metrics | |
| - name: Test pyramid summary (GitHub UI) | |
| if: ${{ always() }} | |
| run: | | |
| { | |
| echo "## Crossplane Dapr Test Pyramid" | |
| echo "" | |
| echo "### By Stack" | |
| echo "" | |
| stack_targets="$(./scripts/test-pyramid-targets.sh stacks)" | |
| for target in ${stack_targets}; do | |
| summary_file="build/reports/test-pyramid/${target}/summary.json" | |
| echo "#### ${target}" | |
| echo "" | |
| if [[ -f "$summary_file" ]]; then | |
| total_tests=$(jq -r '(.totals.tests // "N/A") | tostring' "$summary_file") | |
| total_duration=$(jq -r '(.totals.durationSeconds // "N/A") | tostring' "$summary_file") | |
| generated_at=$(jq -r '.generatedAt // "N/A"' "$summary_file") | |
| echo "- Generated at: \`$generated_at\`" | |
| echo "- Total tests: **$total_tests**" | |
| echo "- Total duration: **${total_duration}s**" | |
| echo "" | |
| echo "| Suite | Tests | Failures | Skipped | Duration (s) | Tests % | Duration % |" | |
| echo "|---|---:|---:|---:|---:|---:|---:|" | |
| jq -r '(.suites // [])[] | "| \(.kind // "N/A") | \(.tests // "N/A") | \(.failures // "N/A") | \(.skipped // "N/A") | \(.durationSeconds // "N/A") | \(.testsPercentage // "N/A") | \(.durationPercentage // "N/A") |"' "$summary_file" | |
| else | |
| echo "No summary file found." | |
| fi | |
| echo "" | |
| done | |
| echo "### By Service" | |
| echo "" | |
| service_targets="$(./scripts/test-pyramid-targets.sh services)" | |
| for target in ${service_targets}; do | |
| summary_file="build/reports/test-pyramid/${target}/summary.json" | |
| echo "#### ${target}" | |
| echo "" | |
| if [[ -f "$summary_file" ]]; then | |
| total_tests=$(jq -r '(.totals.tests // "N/A") | tostring' "$summary_file") | |
| total_duration=$(jq -r '(.totals.durationSeconds // "N/A") | tostring' "$summary_file") | |
| generated_at=$(jq -r '.generatedAt // "N/A"' "$summary_file") | |
| echo "- Generated at: \`$generated_at\`" | |
| echo "- Total tests: **$total_tests**" | |
| echo "- Total duration: **${total_duration}s**" | |
| echo "" | |
| echo "| Suite | Tests | Failures | Skipped | Duration (s) | Tests % | Duration % |" | |
| echo "|---|---:|---:|---:|---:|---:|---:|" | |
| jq -r '(.suites // [])[] | "| \(.kind // "N/A") | \(.tests // "N/A") | \(.failures // "N/A") | \(.skipped // "N/A") | \(.durationSeconds // "N/A") | \(.testsPercentage // "N/A") | \(.durationPercentage // "N/A") |"' "$summary_file" | |
| else | |
| echo "No summary file found." | |
| fi | |
| echo "" | |
| done | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| - name: Publish test pyramid metrics | |
| if: ${{ env.PUSHGATEWAY_URL != '' }} | |
| env: | |
| PUSH_HISTORY: "false" | |
| SKIP_TEST_EXECUTION: "true" | |
| run: ./scripts/push-test-pyramid-metrics.sh "$PUSHGATEWAY_URL" "test-pyramid-latest" "latest" | |
| - name: Upload pyramid reports | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: crossplane-dapr-test-pyramid-${{ github.run_id }} | |
| path: | | |
| crossplane-dapr/build/reports/test-pyramid/**/summary.json | |
| crossplane-dapr/build/reports/test-pyramid/**/test-pyramid.prom | |
| crossplane-dapr/build/reports/test-pyramid/gin/raw/*.json | |
| crossplane-dapr/**/build/test-results/**/TEST-*.xml | |
| if-no-files-found: warn | |
| e2e-smoke: | |
| if: github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: crossplane-dapr | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| cache: gradle | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.23.x' | |
| cache-dependency-path: | | |
| crossplane-dapr/producer-gin/go.sum | |
| crossplane-dapr/consumer-gin/go.sum | |
| - name: Make Gradle executable | |
| run: chmod +x gradlew | |
| - name: E2E smoke (opt-in) | |
| env: | |
| RUN_E2E: "true" | |
| run: make e2e-test |