Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewige committed Dec 13, 2024
1 parent 1281878 commit 5901583
Showing 1 changed file with 11 additions and 61 deletions.
72 changes: 11 additions & 61 deletions .github/workflows/reusable-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 }}

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -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
Expand All @@ -314,15 +314,15 @@ 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: |
${{env.POST_COMMAND}}
- 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: |
Expand Down Expand Up @@ -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-<RUNNER_POOL_NAME> (which matches ebpf-cicd-runner-pool-<RUNNER_POOL_NAME> 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
});

0 comments on commit 5901583

Please sign in to comment.