ci: gate timeout on setup time (#35686)

* gate

* more

* more

* check

* more

* fix

* more

* check

* Revert "check"

This reverts commit c30941bae0.

* back

* more

* like before

* again

* more
pull/35688/head
Maxime Desroches 2 months ago committed by GitHub
parent 9bd7e3e36d
commit eb41875675
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 12
      .github/workflows/selfdrive_tests.yaml
  2. 15
      .github/workflows/setup-with-retry/action.yaml

@ -154,10 +154,11 @@ jobs:
with: with:
submodules: true submodules: true
- uses: ./.github/workflows/setup-with-retry - uses: ./.github/workflows/setup-with-retry
id: setup-step
- name: Build openpilot - name: Build openpilot
run: ${{ env.RUN }} "scons -j$(nproc)" run: ${{ env.RUN }} "scons -j$(nproc)"
- name: Run unit tests - name: Run unit tests
timeout-minutes: ${{ contains(runner.name, 'nsc') && 1 || 20 }} timeout-minutes: ${{ contains(runner.name, 'nsc') && ((steps.setup-step.outputs.duration < 18) && 1 || 2) || 20 }}
run: | run: |
${{ env.RUN }} "$PYTEST --collect-only -m 'not slow' &> /dev/null && \ ${{ env.RUN }} "$PYTEST --collect-only -m 'not slow' &> /dev/null && \
MAX_EXAMPLES=1 $PYTEST -m 'not slow' && \ MAX_EXAMPLES=1 $PYTEST -m 'not slow' && \
@ -178,6 +179,7 @@ jobs:
with: with:
submodules: true submodules: true
- uses: ./.github/workflows/setup-with-retry - uses: ./.github/workflows/setup-with-retry
id: setup-step
- name: Cache test routes - name: Cache test routes
id: dependency-cache id: dependency-cache
uses: actions/cache@v4 uses: actions/cache@v4
@ -188,7 +190,7 @@ jobs:
run: | run: |
${{ env.RUN }} "scons -j$(nproc)" ${{ env.RUN }} "scons -j$(nproc)"
- name: Run replay - name: Run replay
timeout-minutes: ${{ contains(runner.name, 'nsc') && (steps.dependency-cache.outputs.cache-hit == 'true') && 1 || 20 }} timeout-minutes: ${{ contains(runner.name, 'nsc') && (steps.dependency-cache.outputs.cache-hit == 'true') && ((steps.setup-step.outputs.duration < 18) && 1 || 2) || 20 }}
run: | run: |
${{ env.RUN }} "selfdrive/test/process_replay/test_processes.py -j$(nproc) && \ ${{ env.RUN }} "selfdrive/test/process_replay/test_processes.py -j$(nproc) && \
chmod -R 777 /tmp/comma_download_cache" chmod -R 777 /tmp/comma_download_cache"
@ -230,6 +232,7 @@ jobs:
with: with:
submodules: true submodules: true
- uses: ./.github/workflows/setup-with-retry - uses: ./.github/workflows/setup-with-retry
id: setup-step
- name: Cache test routes - name: Cache test routes
id: routes-cache id: routes-cache
uses: actions/cache@v4 uses: actions/cache@v4
@ -239,7 +242,7 @@ jobs:
- name: Build openpilot - name: Build openpilot
run: ${{ env.RUN }} "scons -j$(nproc)" run: ${{ env.RUN }} "scons -j$(nproc)"
- name: Test car models - name: Test car models
timeout-minutes: ${{ contains(runner.name, 'nsc') && (steps.routes-cache.outputs.cache-hit == 'true') && 1 || 6 }} timeout-minutes: ${{ contains(runner.name, 'nsc') && (steps.routes-cache.outputs.cache-hit == 'true') && ((steps.setup-step.outputs.duration < 18) && 1 || 2) || 6 }}
run: | run: |
${{ env.RUN }} "MAX_EXAMPLES=1 $PYTEST selfdrive/car/tests/test_models.py && \ ${{ env.RUN }} "MAX_EXAMPLES=1 $PYTEST selfdrive/car/tests/test_models.py && \
chmod -R 777 /tmp/comma_download_cache" chmod -R 777 /tmp/comma_download_cache"
@ -316,11 +319,12 @@ jobs:
with: with:
submodules: true submodules: true
- uses: ./.github/workflows/setup-with-retry - uses: ./.github/workflows/setup-with-retry
id: setup-step
- name: Build openpilot - name: Build openpilot
run: | run: |
${{ env.RUN }} "scons -j$(nproc)" ${{ env.RUN }} "scons -j$(nproc)"
- name: Driving test - name: Driving test
timeout-minutes: 1 timeout-minutes: ${{ (steps.setup-step.outputs.duration < 18) && 1 || 2 }}
run: | run: |
${{ env.RUN }} "source selfdrive/test/setup_xvfb.sh && \ ${{ env.RUN }} "source selfdrive/test/setup_xvfb.sh && \
source selfdrive/test/setup_vsound.sh && \ source selfdrive/test/setup_vsound.sh && \

@ -10,9 +10,17 @@ inputs:
required: false required: false
default: 30 default: 30
outputs:
duration:
description: 'Duration of the setup process in seconds'
value: ${{ steps.get_duration.outputs.duration }}
runs: runs:
using: "composite" using: "composite"
steps: steps:
- id: start_time
shell: bash
run: echo "START_TIME=$(date +%s)" >> $GITHUB_ENV
- id: setup1 - id: setup1
uses: ./.github/workflows/setup uses: ./.github/workflows/setup
continue-on-error: true continue-on-error: true
@ -35,3 +43,10 @@ runs:
uses: ./.github/workflows/setup uses: ./.github/workflows/setup
with: with:
is_retried: true is_retried: true
- id: get_duration
shell: bash
run: |
END_TIME=$(date +%s)
DURATION=$((END_TIME - START_TIME))
echo "Total duration: $DURATION seconds"
echo "duration=$DURATION" >> $GITHUB_OUTPUT

Loading…
Cancel
Save