From 5901583d39cb9d9220187c74d58f2969e1fdb1da Mon Sep 17 00:00:00 2001 From: "Matt Ige (from Dev Box)" Date: Fri, 13 Dec 2024 11:23:02 -0800 Subject: [PATCH] WIP --- .github/workflows/reusable-test.yml | 72 +++++------------------------ 1 file changed, 11 insertions(+), 61 deletions(-) diff --git a/.github/workflows/reusable-test.yml b/.github/workflows/reusable-test.yml index a755f804e9..5b97b46a0f 100644 --- a/.github/workflows/reusable-test.yml +++ b/.github/workflows/reusable-test.yml @@ -96,7 +96,7 @@ jobs: - name: Configure runner (Move to setup script directly later) id: configure-runner - if: contains(inputs.environment, '1es') + if: (inputs.self-hosted-runner) run: | powershell.exe "cd C:\bin\CloudTestWorker\ProvisioningScript; dir; .\Setup_orig.ps1" # powershell.exe "Get-NetAdapter" @@ -125,7 +125,7 @@ jobs: # Perform shallow checkout for self-hosted runner. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - if: contains(inputs.environment, '1es') && (steps.skip_check.outputs.should_skip != 'true') + if: (inputs.self-hosted-runner) && (steps.skip_check.outputs.should_skip != 'true') with: ref: ${{ github.event.workflow_run.head_branch }} @@ -174,7 +174,7 @@ jobs: - name: Set up OpenCppCoverage and add to PATH id: set_up_opencppcoverage - if: (inputs.code_coverage == true) && !contains(inputs.environment, '1es') && (steps.skip_check.outputs.should_skip != 'true') + if: (inputs.code_coverage == true) && !(inputs.self-hosted-runner) && (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 +191,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: contains(inputs.environment, '1es') && (steps.skip_check.outputs.should_skip != 'true') + if: (inputs.self-hosted-runner) && (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 +248,14 @@ jobs: .\export_program_info_sample.exe - name: Run pre test command - if: steps.skip_check.outputs.should_skip != 'true' && !contains(inputs.environment, '1es') + if: steps.skip_check.outputs.should_skip != 'true' && !(inputs.self-hosted-runner) 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' && contains(inputs.environment, '1es') + if: steps.skip_check.outputs.should_skip != 'true' && (inputs.self-hosted-runner) id: run_pre_test_command_self_hosted working-directory: ./${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}} run: | @@ -297,14 +297,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') && contains(inputs.environment, '1es') && (inputs.fault_injection != true) + if: (inputs.code_coverage == false) && (steps.skip_check.outputs.should_skip != 'true') && (inputs.self-hosted-runner) && (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') && contains(inputs.environment, '1es') && (inputs.fault_injection != true) + if: (inputs.code_coverage == false) && (steps.skip_check.outputs.should_skip != 'true') && (inputs.self-hosted-runner) && (inputs.fault_injection != true) id: run_test_without_code_coverage working-directory: ./${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}} shell: cmd @@ -314,7 +314,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') && contains(inputs.environment, '1es') + if: (success() || failure()) && (steps.skip_check.outputs.should_skip != 'true') && (inputs.self-hosted-runner) id: run_post_test_command working-directory: ./${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}} run: | @@ -322,7 +322,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') && contains(inputs.environment, '1es') + if: (success() || failure()) && (steps.skip_check.outputs.should_skip != 'true') && (inputs.self-hosted-runner) id: run_post_test_command_self_hosted working-directory: ./${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}} run: | @@ -539,54 +539,4 @@ jobs: title: title, body: body, labels: label_array, - }); - - - - - - - # set-job-environment: - # # The following environments are supported: - # # - Any of the github environments. - # # - 1es- (which matches ebpf-cicd-runner-pool- in the 1es pool) - # runs-on: ubuntu-latest - # outputs: - # runs_on: ${{ steps.set_runner_1es.outputs.runs_on || steps.set_runner_github.outputs.runs_on }} - # runs_on_pool: ${{ steps.set_runner_1es.outputs.runs_on_pool || '' }} - # steps: - # - name: Set 1es runner type - # id: set_runner_1es - # if: contains(inputs.environment, '1es') - # run: | - # pool_name=$(echo "${{ inputs.environment }}" | sed 's/.*1es-//') - # echo "pool_name=$pool_name" - # echo "runs_on=self-hosted" >> $GITHUB_OUTPUT - # echo "runs_on_pool=1ES.Pool=ebpf-cicd-runner-pool-$pool_name" >> $GITHUB_OUTPUT - # - name: Set github runner type - # id: set_runner_github - # if: !contains(inputs.environment, '1es') - # run: | - # echo "runs_on=${{ inputs.environment }}" >> $GITHUB_OUTPUT - -# jobs: -# build: -# runs-on: ${{ matrix.runner }} -# strategy: -# matrix: -# runner: [] -# include: -# - env: self-hosted -# runner: [self-hosted, 1ES.Pool=ebpf-cicd-runner-pool-server-2019] -# - env: windows -# runner: [windows-2022] - - - # - ${{ needs.set-job-environment.outputs.runs_on }} - # - ${{ needs.set-job-environment.outputs.runs_on_pool }} - - # runs-on: - # - self-hosted - # - 1ES.Pool=ebpf-cicd-runner-pool-server-2019 - # runs-on: - # - windows-2022 \ No newline at end of file + }); \ No newline at end of file