Skip to content

Fixup github actions #2391

Fixup github actions

Fixup github actions #2391

Workflow file for this run

# CI Flow (high-level)
#
# ```mermaid
# flowchart TD
# A[Checkout] --> B[Detect native-related changes]
# B --> C[Build Debug x64 with tests]
# C --> D[Run managed tests wrapper]
# C --> E{Native changes?}
# E -->|yes| F[Wrapper starts native build in parallel]
# D --> G{Native changes?}
# F --> G
# G -->|yes| H[Run native tests -NoBuild]
# G -->|no| I[Write native-skip summary]
# H --> J[Summarize native results]
# I --> K[Upload TRX]
# J --> K
# K --> L[Upload logs on failure only]
# L --> M[Publish test results]
# ```
#
name: Flex CI
on:
push:
branches: ["release/**", "main", "feature/PubSub"]
pull_request:
branches: ["release/**", "main", "feature/PubSub"]
workflow_dispatch:
permissions:
contents: read
checks: write
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
debug_build_and_test:
name: Build Debug and run managed/native tests
runs-on: windows-latest
steps:
- name: Checkout Files
uses: actions/checkout@v4
id: checkout
with:
fetch-depth: 0
- name: Detect native source changes
id: changes
shell: powershell
run: |
.\Build\Agent\Detect-NativeChanges.ps1 `
-EventName '${{ github.event_name }}' `
-PullRequestBaseRef '${{ github.event.pull_request.base.ref }}' `
-EventBefore '${{ github.event.before }}'
- name: Build Debug x64 (with tests)
id: build_debug
shell: powershell
run: |
.\build.ps1 -Configuration Debug -Platform x64 -BuildTests
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Run managed tests (filtered)
id: test_managed
shell: powershell
run: |
.\Build\Agent\Invoke-ManagedTestsWithOptionalNativeBuild.ps1 `
-Configuration Debug `
-NativeChanged '${{ steps.changes.outputs.native }}'
- name: Run native tests
id: test_native
shell: powershell
if: ${{ steps.changes.outputs.native == 'true' }}
run: |
.\test.ps1 -Configuration Debug -Native -NoBuild
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Report native test skip
if: ${{ steps.changes.outputs.native != 'true' }}
shell: powershell
run: |
Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value '### Native test summary'
Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value ''
Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value 'Native tests skipped: no native-related file changes detected.'
- name: Summarize native test results
if: ${{ always() && steps.changes.outputs.native == 'true' }}
shell: powershell
run: |
.\Build\Agent\Summarize-NativeTestResults.ps1 -Configuration Debug
- name: Upload TRX test results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: trx-results
path: |
**/*.trx
if-no-files-found: warn
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() && failure() }}
with:
name: build-logs
path: |
./*.log
./Output/**/*.log
publish_test_results:
name: Publish Test Results
if: ${{ !cancelled() }}
needs: debug_build_and_test
runs-on: ubuntu-latest
steps:
- name: Download TRX artifacts
uses: actions/download-artifact@v4
with:
name: trx-results
path: test-results
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@27d65e188ec43221b20d26de30f4892fad91df2f
with:
files: 'test-results/**/*.trx'
check_name: NUnit Tests
comment_mode: off
job_summary: true
fail_on: test failures