From 085aa1215870a46f64854cb58ceb05e5ad308e3f Mon Sep 17 00:00:00 2001 From: "Matt Ige (from Dev Box)" Date: Fri, 13 Dec 2024 10:10:25 -0800 Subject: [PATCH] WIP --- .github/workflows/cicd.yml | 7 +- .github/workflows/reusable-test.yml | 100 +++++++++++++++------------- 2 files changed, 58 insertions(+), 49 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 01719217f0..dcdbef10df 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -69,7 +69,7 @@ jobs: # Exclude [processes] test that CodeCoverage can't work with. test_command: .\unit_tests.exe -d yes ~[processes] build_artifact: Build-x64 - environment: [windows-2022] + environment: windows-2022 code_coverage: true gather_dumps: true capture_etw: true @@ -88,9 +88,8 @@ jobs: post_test: .\cleanup_ebpf_cicd_tests.ps1 -KmTracing $true name: driver_ws2019 build_artifact: Build-x64 - environment: [self-hosted, 1ES.Pool=ebpf-cicd-runner-pool-server-2019] - # - self-hosted - # - 1ES.Pool=ebpf-cicd-runner-pool-server-2019 + environment: server-2019 + self-hosted-runner: true # driver test copies dumps to testlog folder. gather_dumps: false # driver tests manually gather code coverage diff --git a/.github/workflows/reusable-test.yml b/.github/workflows/reusable-test.yml index c63c91a156..8487bcb799 100644 --- a/.github/workflows/reusable-test.yml +++ b/.github/workflows/reusable-test.yml @@ -22,8 +22,11 @@ on: # The environment to run this test on. environment: description: 'Environment to run tests on' - type: array + type: string required: true + self-hosted-runner: + type: boolean + required: false # Set to true to gather code coverage when this test runs. code_coverage: required: false @@ -62,43 +65,7 @@ permissions: issues: write # Required to create issues. jobs: - # 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] - run_test: - needs: set-job-environment # Due to app-verifier, unit tests take a lot longer to execute. Increase the timeout to 90 minutes. timeout-minutes: 90 @@ -106,14 +73,7 @@ jobs: matrix: configurations: ${{ fromJSON(inputs.configurations) }} - runs-on: ${{ inputs.environment }} - # - ${{ 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 + runs-on: ${{ (inputs.self-hosted-runner) && fromJSON('[ "self-hosted", " 1ES.Pool=ebpf-cicd-runner-pool-${{ inputs.environment }}"]') || ${{ inputs.environment }} }} env: # Configuration type to build. SOURCE_ROOT: ${{github.workspace}} @@ -579,3 +539,53 @@ jobs: 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