Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
runs_on:
required: false
type: string
default: "self-hosted"
default: '["self-hosted", "singlethreaded"]'
jobs:
lint:
uses: ./.github/workflows/test-ts-lint.yml
Expand All @@ -21,7 +21,7 @@ jobs:
lint_command: "npm run lint"
fix_command: "npm run lint-fix"
build-baremetal:
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
name: Build / Baremetal
needs: lint
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gh-submodules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ on:
runs_on:
required: false
type: string
default: "self-hosted"
default: '["self-hosted", "singlethreaded"]'

jobs:
manage-submodules:
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
name: Manage Submodules
permissions:
contents: write
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/meta-regression-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ on:
runs_on:
required: false
type: string
default: "self-hosted"
default: '["self-hosted", "singlethreaded"]'
outputs:
has_regressions:
description: "Boolean indicating if regressions were found."
Expand All @@ -46,7 +46,7 @@ on:

jobs:
analyze:
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
outputs:
HAS_REGRESSIONS: ${{ steps.check-regressions-script.outputs.HAS_REGRESSIONS }}
REGRESSION_COUNT: ${{ steps.check-regressions-script.outputs.REGRESSION_COUNT }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ on:
runs_on:
required: false
type: string
default: "ubuntu-latest"
default: '["ubuntu-latest"]'
jobs:
build-and-push-ghcr:
name: Build and Push Docker Image to GHCR
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
permissions:
contents: read # To checkout the repository
packages: write # To push packages to GHCR
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/regression-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
description: "Runner label for the regression analysis job."
required: false
type: string
default: "ubuntu-latest"
default: '["ubuntu-latest"]'
baseline_label:
description: "Display name for the baseline (target) test results."
required: true
Expand Down Expand Up @@ -129,7 +129,7 @@ on:

jobs:
regression-analysis:
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
outputs:
has_regressions: ${{ steps.analyze.outputs.has_regressions }}
regression_count: ${{ steps.analyze.outputs.regression_count }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/run-branch-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ on:
description: "Runner label."
required: false
type: string
default: "self-hosted"
default: '["self-hosted", "multithreaded"]'
parallel_workers:
description: "Number of parallel pytest workers. Use 'auto' for CPU count."
description: "Number of parallel pytest workers. Leave empty for auto-detect (6 for multithreaded, 1 for singlethreaded). Use 'auto' for CPU count (caution: detects host CPUs)."
required: false
type: string
default: "auto"
default: ""
secrets:
DISCORD_WEBHOOK_URL:
required: false
Expand All @@ -38,7 +38,7 @@ on:
jobs:
# Detect which test frameworks are present
detect-frameworks:
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
outputs:
has_pytest: ${{ steps.detect.outputs.has_pytest }}
# Future: has_jest, has_xunit, etc.
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
test-target:
needs: detect-frameworks
if: needs.detect-frameworks.outputs.has_pytest == 'true'
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
outputs:
total: ${{ steps.results.outputs.total }}
passed: ${{ steps.results.outputs.passed }}
Expand Down Expand Up @@ -570,7 +570,7 @@ jobs:
if: |
always() &&
(needs.compare.outputs.has_regressions == 'true' || needs.compare.result == 'failure')
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
steps:
- name: Send notification
env:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-bandit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
runs_on:
required: false
type: string
default: "ubuntu-latest"
default: '["ubuntu-latest"]'
outputs:
bandit_issues_json:
description: "JSON output of Bandit issues on PR branch"
Expand All @@ -21,7 +21,7 @@ jobs:
# Job 1: Run Bandit on the PR branch
run-bandit:
name: Run Bandit on PR Branch & Extract Results
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
outputs:
bandit_issues_json: ${{ steps.extract-pr.outputs.BANDIT_JSON }}
steps:
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
# Job 2: Run Bandit on the target branch for comparison
run-bandit-on-target:
name: Run Bandit on Target Branch
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
outputs:
bandit_target_json: ${{ steps.extract-target.outputs.TARGET_JSON }}
steps:
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
# Job 3: Compare the PR results against the target to detect regressions
compare-bandit:
name: Compare Bandit Issues (Regression Analysis)
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
needs: [run-bandit, run-bandit-on-target]
steps:
- name: Compare JSON
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-cs-nunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ on:
runs_on:
required: false
type: string
default: "self-hosted"
default: '["self-hosted", "multithreaded"]'
secrets:
DISCORD_WEBHOOK_URL:
description: "Discord Webhook URL for failure notifications. If not provided, notifications are skipped."
Expand Down Expand Up @@ -72,7 +72,7 @@ on:

jobs:
test-source-branch:
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
defaults:
run:
shell: bash
Expand Down Expand Up @@ -402,7 +402,7 @@ jobs:
if-no-files-found: ignore

test-target-branch:
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
defaults:
run:
shell: bash
Expand Down Expand Up @@ -773,7 +773,7 @@ jobs:
needs.compare-results.result == 'failure' ||
needs.perform-regression-analysis.outputs.has_regressions == 'true'
)
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
outputs:
message_body: ${{ steps.construct_notification.outputs.message_body_out }}
ping_user_ids: ${{ steps.construct_notification.outputs.ping_user_ids_out }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-cs-xunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ on:
runs_on:
required: false
type: string
default: "self-hosted"
default: '["self-hosted", "multithreaded"]'
secrets:
DISCORD_WEBHOOK_URL:
description: "Discord Webhook URL for failure notifications. If not provided, notifications are skipped."
Expand Down Expand Up @@ -72,7 +72,7 @@ on:

jobs:
test-source-branch:
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
defaults:
run:
shell: bash
Expand Down Expand Up @@ -399,7 +399,7 @@ jobs:
if-no-files-found: ignore

test-target-branch:
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
defaults:
run:
shell: bash
Expand Down Expand Up @@ -770,7 +770,7 @@ jobs:
needs.compare-results.result == 'failure' ||
needs.perform-regression-analysis.outputs.has_regressions == 'true'
)
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
outputs:
message_body: ${{ steps.construct_notification.outputs.message_body_out }}
ping_user_ids: ${{ steps.construct_notification.outputs.ping_user_ids_out }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-js-jest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ on:
runs_on:
required: false
type: string
default: "self-hosted"
default: '["self-hosted", "multithreaded"]'
secrets:
DISCORD_WEBHOOK_URL:
description: "Discord Webhook URL for failure notifications. If not provided, notifications are skipped."
Expand Down Expand Up @@ -82,7 +82,7 @@ on:

jobs:
test-source-branch:
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
outputs:
total: ${{ steps.extract-results.outputs.total }}
passed: ${{ steps.extract-results.outputs.passed }}
Expand Down Expand Up @@ -409,7 +409,7 @@ jobs:
if-no-files-found: ignore

test-target-branch:
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
outputs:
total: ${{ steps.check-collection.outputs.has_collection_errors == 'true' && steps.set-error-outputs.outputs.total || steps.extract-results.outputs.total }}
passed: ${{ steps.check-collection.outputs.has_collection_errors == 'true' && steps.set-error-outputs.outputs.passed || steps.extract-results.outputs.passed }}
Expand Down Expand Up @@ -806,7 +806,7 @@ jobs:
needs.compare-results.result == 'failure' ||
needs.perform-regression-analysis.outputs.has_regressions == 'true'
)
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
outputs:
message_body: ${{ steps.construct_notification.outputs.message_body_out }}
ping_user_ids: ${{ steps.construct_notification.outputs.ping_user_ids_out }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-js-mocha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ on:
runs_on:
required: false
type: string
default: "self-hosted"
default: '["self-hosted", "multithreaded"]'
secrets:
DISCORD_WEBHOOK_URL:
description: "Discord Webhook URL for failure notifications. If not provided, notifications are skipped."
Expand Down Expand Up @@ -82,7 +82,7 @@ on:

jobs:
test-source-branch:
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
outputs:
total: ${{ steps.extract-results.outputs.total }}
passed: ${{ steps.extract-results.outputs.passed }}
Expand Down Expand Up @@ -439,7 +439,7 @@ jobs:
if-no-files-found: ignore

test-target-branch:
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
outputs:
total: ${{ steps.check-collection.outputs.has_collection_errors == 'true' && steps.set-error-outputs.outputs.total || steps.extract-results.outputs.total }}
passed: ${{ steps.check-collection.outputs.has_collection_errors == 'true' && steps.set-error-outputs.outputs.passed || steps.extract-results.outputs.passed }}
Expand Down Expand Up @@ -869,7 +869,7 @@ jobs:
needs.compare-results.result == 'failure' ||
needs.perform-regression-analysis.outputs.has_regressions == 'true'
)
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
outputs:
message_body: ${{ steps.construct_notification.outputs.message_body_out }}
ping_user_ids: ${{ steps.construct_notification.outputs.ping_user_ids_out }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-py-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
runs_on:
required: false
type: string
default: '["self-hosted", "multithreaded"]'
default: '["self-hosted", "singlethreaded"]'
outputs:
auto_formatted:
description: "Whether Black auto-formatted files and pushed changes."
Expand Down
25 changes: 18 additions & 7 deletions .github/workflows/test-py-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ on:
description: "Runner label for the test job."
required: false
type: string
default: "self-hosted"
default: '["self-hosted", "multithreaded"]'
artifact_name:
description: "Name for the test results artifact."
required: true
type: string
parallel_workers:
description: "Number of parallel workers for pytest-xdist. Use 'auto' for CPU count, or a number. Set to '1' to disable."
description: "Number of parallel workers for pytest-xdist. Leave empty for auto-detect based on runner (6 for multithreaded, 1 for singlethreaded). Use 'auto' for CPU count (caution: detects host CPUs, not container), or a number."
required: false
type: string
default: "auto"
default: ""
outputs:
total:
description: "Total number of tests"
Expand Down Expand Up @@ -64,7 +64,7 @@ on:

jobs:
test:
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
outputs:
total: ${{ steps.extract-results.outputs.total }}
passed: ${{ steps.extract-results.outputs.passed }}
Expand Down Expand Up @@ -152,10 +152,21 @@ jobs:
continue-on-error: true
if: steps.check-collection.outputs.has_collection_errors != 'true'
run: |
echo "Running tests with ${{ inputs.parallel_workers }} workers..."
# Determine worker count based on input or runner type
WORKERS="${{ inputs.parallel_workers }}"
if [ -z "$WORKERS" ]; then
# Auto-detect based on runner type
if echo '${{ inputs.runs_on }}' | grep -q "multithreaded"; then
WORKERS="6"
else
WORKERS="1"
fi
fi
echo "Running tests with $WORKERS workers..."

PARALLEL_FLAG=""
if [ "${{ inputs.parallel_workers }}" != "1" ]; then
PARALLEL_FLAG="-n ${{ inputs.parallel_workers }}"
if [ "$WORKERS" != "1" ]; then
PARALLEL_FLAG="-n $WORKERS"
fi

# Run pytest and capture exit code
Expand Down
Loading