From e4674876144d28ae306c30346ab7e0f0f807ef3d Mon Sep 17 00:00:00 2001 From: "Matt Ige (from Dev Box)" Date: Fri, 13 Dec 2024 13:27:12 -0800 Subject: [PATCH] WIP --- .github/workflows/reusable-test.yml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/reusable-test.yml b/.github/workflows/reusable-test.yml index 5b97b46a0f..399316a41f 100644 --- a/.github/workflows/reusable-test.yml +++ b/.github/workflows/reusable-test.yml @@ -89,6 +89,11 @@ jobs: TEST_TIMEOUT: 3600 # 1 hour timeout for tests. steps: + - name: Log runson + run: | + echo "Running on ${{input.environment}} + echo "" + - name: Harden Runner uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 with: @@ -96,7 +101,7 @@ jobs: - name: Configure runner (Move to setup script directly later) id: configure-runner - if: (inputs.self-hosted-runner) + if: (inputs.self-hosted-runner == true) run: | powershell.exe "cd C:\bin\CloudTestWorker\ProvisioningScript; dir; .\Setup_orig.ps1" # powershell.exe "Get-NetAdapter" @@ -125,7 +130,7 @@ jobs: # Perform shallow checkout for self-hosted runner. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - if: (inputs.self-hosted-runner) && (steps.skip_check.outputs.should_skip != 'true') + if: (inputs.self-hosted-runner == true) && (steps.skip_check.outputs.should_skip != 'true') with: ref: ${{ github.event.workflow_run.head_branch }} @@ -174,7 +179,7 @@ jobs: - name: Set up OpenCppCoverage and add to PATH id: set_up_opencppcoverage - if: (inputs.code_coverage == true) && !(inputs.self-hosted-runner) && (steps.skip_check.outputs.should_skip != 'true') + if: (inputs.code_coverage == true) && (inputs.self-hosted-runner != true) && (steps.skip_check.outputs.should_skip != 'true') run: | choco install -y --requirechecksum=true --checksum=2295A733DA39412C61E4F478677519DD0BB1893D88313CE56B468C9E50517888 --checksum-type=sha256 OpenCppCoverage echo "C:\Program Files\OpenCppCoverage" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append @@ -191,7 +196,7 @@ jobs: New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" -Name "DumpFolder" -Value "$dump_path" -PropertyType ExpandString -ErrorAction SilentlyContinue - name: Remove existing artifacts - if: (inputs.self-hosted-runner) && (steps.skip_check.outputs.should_skip != 'true') + if: (inputs.self-hosted-runner == true) && (steps.skip_check.outputs.should_skip != 'true') run: | Remove-Item -Path ${{github.workspace}}\${{env.BUILD_PLATFORM}}\${{env.BUILD_CONFIGURATION}} -Recurse -Force -ErrorAction SilentlyContinue @@ -248,14 +253,14 @@ jobs: .\export_program_info_sample.exe - name: Run pre test command - if: steps.skip_check.outputs.should_skip != 'true' && !(inputs.self-hosted-runner) + if: steps.skip_check.outputs.should_skip != 'true' && (inputs.self-hosted-runner != true) id: run_pre_test_command working-directory: ./${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}} run: | ${{env.PRE_COMMAND}} - name: Run pre test command on self-hosted runner - if: steps.skip_check.outputs.should_skip != 'true' && (inputs.self-hosted-runner) + if: steps.skip_check.outputs.should_skip != 'true' && (inputs.self-hosted-runner == true) id: run_pre_test_command_self_hosted working-directory: ./${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}} run: | @@ -297,14 +302,14 @@ jobs: OpenCppCoverage.exe -q --sources %CD% --excluded_sources %CD%\external\Catch2 --export_type cobertura:ebpf_for_windows.xml --working_dir ${{env.BUILD_PLATFORM}}\${{env.BUILD_CONFIGURATION}} -- powershell .\Run-Test.ps1 ${{env.DUMP_PATH}} ${{env.TEST_TIMEOUT}} ${{env.TEST_COMMAND}} - name: Run test on self-hosted runner - if: (inputs.code_coverage == false) && (steps.skip_check.outputs.should_skip != 'true') && (inputs.self-hosted-runner) && (inputs.fault_injection != true) + if: (inputs.code_coverage == false) && (steps.skip_check.outputs.should_skip != 'true') && (inputs.self-hosted-runner == true) && (inputs.fault_injection != true) id: run_test_self_hosted working-directory: ./${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}} run: | ${{env.TEST_COMMAND}} -LogFileName ${{ runner.name }}.log -SelfHostedRunnerName ${{ runner.name }} - name: Run test without Code Coverage - if: (inputs.code_coverage == false) && (steps.skip_check.outputs.should_skip != 'true') && (inputs.self-hosted-runner) && (inputs.fault_injection != true) + if: (inputs.code_coverage == false) && (steps.skip_check.outputs.should_skip != 'true') && (inputs.self-hosted-runner == true) && (inputs.fault_injection != true) id: run_test_without_code_coverage working-directory: ./${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}} shell: cmd @@ -314,7 +319,7 @@ jobs: - name: Run post test command # Run the post test command even if the workflow has failed. - if: (success() || failure()) && (steps.skip_check.outputs.should_skip != 'true') && (inputs.self-hosted-runner) + if: (success() || failure()) && (steps.skip_check.outputs.should_skip != 'true') && (inputs.self-hosted-runner == true) id: run_post_test_command working-directory: ./${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}} run: | @@ -322,7 +327,7 @@ jobs: - name: Run post test command on self-hosted runner # Run the post test command even if the workflow has failed. - if: (success() || failure()) && (steps.skip_check.outputs.should_skip != 'true') && (inputs.self-hosted-runner) + if: (success() || failure()) && (steps.skip_check.outputs.should_skip != 'true') && (inputs.self-hosted-runner == true) id: run_post_test_command_self_hosted working-directory: ./${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}} run: |