Compare commits

...

3 Commits

Author SHA1 Message Date
Aleksei Sviridkin
8f686a01e9 fix(ci): address CodeRabbit review comments
- Add capture_runner.result check to collect_debug_information
- Add test_apps to cleanup job needs array
- Add capture_runner.result check to cleanup job

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2025-12-29 17:23:16 +03:00
Aleksei Sviridkin
e67f8b678a fix(ci): use multiline syntax for run command
Fix YAML parsing error caused by colon in echo string.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2025-12-29 17:13:43 +03:00
Aleksei Sviridkin
88454f7440 ci(workflow): fix runner affinity for e2e tests
Add capture_runner job that captures the runner name and passes it
to all downstream jobs via outputs. This ensures all e2e jobs run
on the same self-hosted runner where the sandbox container exists.

Problem: Jobs were distributed across multiple runners, causing
"No such container" errors when test jobs tried to access the
sandbox container created on a different runner.

Solution: Use runner.name output to pin all related jobs to the
same runner.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2025-12-29 17:01:55 +03:00

View File

@@ -141,15 +141,26 @@ jobs:
core.setOutput('installer_id', installerId);
core.setOutput('disk_id', diskId);
capture_runner:
name: "Capture runner"
runs-on: [self-hosted]
outputs:
runner_name: ${{ runner.name }}
needs: ["build", "resolve_assets"]
if: ${{ always() && (needs.build.result == 'success' || needs.resolve_assets.result == 'success') }}
steps:
- name: Capture runner name
run: |
echo "All e2e jobs will run on runner: ${{ runner.name }}"
prepare_env:
name: "Prepare environment"
runs-on: [self-hosted]
runs-on: ${{ needs.capture_runner.outputs.runner_name }}
permissions:
contents: read
packages: read
needs: ["build", "resolve_assets"]
if: ${{ always() && (needs.build.result == 'success' || needs.resolve_assets.result == 'success') }}
needs: ["capture_runner"]
if: ${{ always() && needs.capture_runner.result == 'success' }}
steps:
# ▸ Checkout and prepare the codebase
@@ -212,11 +223,11 @@ jobs:
install_cozystack:
name: "Install Cozystack"
runs-on: [self-hosted]
runs-on: ${{ needs.capture_runner.outputs.runner_name }}
permissions:
contents: read
packages: read
needs: ["prepare_env", "resolve_assets"]
needs: ["capture_runner", "prepare_env", "resolve_assets"]
if: ${{ always() && needs.prepare_env.result == 'success' }}
steps:
@@ -288,8 +299,8 @@ jobs:
fail-fast: false
matrix: ${{ fromJson(needs.detect_test_matrix.outputs.matrix) }}
name: Test ${{ matrix.app }}
runs-on: [self-hosted]
needs: [install_cozystack,detect_test_matrix]
runs-on: ${{ needs.capture_runner.outputs.runner_name }}
needs: [capture_runner, install_cozystack, detect_test_matrix]
if: ${{ always() && (needs.install_cozystack.result == 'success' && needs.detect_test_matrix.result == 'success') }}
steps:
@@ -312,9 +323,9 @@ jobs:
collect_debug_information:
name: Collect debug information
runs-on: [self-hosted]
needs: [test_apps]
if: ${{ always() }}
runs-on: ${{ needs.capture_runner.outputs.runner_name }}
needs: [capture_runner, test_apps]
if: ${{ always() && needs.capture_runner.result == 'success' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
@@ -346,9 +357,9 @@ jobs:
cleanup:
name: Tear down environment
runs-on: [self-hosted]
needs: [collect_debug_information]
if: ${{ always() && needs.test_apps.result == 'success' }}
runs-on: ${{ needs.capture_runner.outputs.runner_name }}
needs: [capture_runner, collect_debug_information, test_apps]
if: ${{ always() && needs.capture_runner.result == 'success' && needs.test_apps.result == 'success' }}
steps:
- name: Checkout code