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 4e07b18 commit 36900a9
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 28 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -88,7 +88,9 @@ jobs:
post_test: .\cleanup_ebpf_cicd_tests.ps1 -KmTracing $true
name: driver_ws2019
build_artifact: Build-x64
environment: 1es-server-2019
environment: [self-hosted, 1ES.Pool=ebpf-cicd-runner-pool-server-2019]
# - self-hosted
# - 1ES.Pool=ebpf-cicd-runner-pool-server-2019
# driver test copies dumps to testlog folder.
gather_dumps: false
# driver tests manually gather code coverage
Expand Down
71 changes: 45 additions & 26 deletions .github/workflows/reusable-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
# The environment to run this test on.
environment:
description: 'Environment to run tests on'
type: string
type: array
required: true
# Set to true to gather code coverage when this test runs.
code_coverage:
Expand Down Expand Up @@ -62,28 +62,41 @@ permissions:
issues: write # Required to create issues.

jobs:
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 runner type (1es)
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 runner type (github hosted)
id: set_runner_github
if: !contains(inputs.environment, '1es')
run: |
echo "runs_on=${{ inputs.environment }}" >> $GITHUB_OUTPUT
# 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]

run_test:
needs: set-job-environment
# Due to app-verifier, unit tests take a lot longer to execute. Increase the timeout to 90 minutes.
Expand All @@ -92,9 +105,15 @@ jobs:
strategy:
matrix:
configurations: ${{ fromJSON(inputs.configurations) }}
runs-on:
- ${{ needs.set-job-environment.outputs.runs_on }}
- ${{ needs.set-job-environment.outputs.runs_on_pool }}

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
env:
# Configuration type to build.
SOURCE_ROOT: ${{github.workspace}}
Expand Down

0 comments on commit 36900a9

Please sign in to comment.