only clean/checkout/download artifacts on first attempt

This commit is contained in:
hathach
2025-07-08 17:20:48 +07:00
parent 0c197a2eae
commit 091c6a7889
2 changed files with 24 additions and 21 deletions

View File

@@ -199,26 +199,20 @@ jobs:
runs-on: [self-hosted, X64, hathach, hardware-in-the-loop]
steps:
- name: Clean workspace
if: github.run_attempt == '1'
run: |
# Skip boards that passed with previous run
if [ -f ${{ env.HIL_JSON }}.skip ]; then
SKIP_ARGS=$(cat "${HIL_JSON}.skip")
else
SKIP_ARGS=""
fi
echo "SKIP_ARGS=$SKIP_ARGS"
echo "SKIP_ARGS=$SKIP_ARGS" >> $GITHUB_ENV
echo "Cleaning up previous run"
echo "Cleaning up for the first run"
rm -rf "${{ github.workspace }}"
mkdir -p "${{ github.workspace }}"
- name: Checkout TinyUSB
if: github.run_attempt == '1'
uses: actions/checkout@v4
with:
sparse-checkout: test/hil
- name: Download Artifacts
if: github.run_attempt == '1'
uses: actions/download-artifact@v4
with:
path: cmake-build
@@ -227,7 +221,15 @@ jobs:
- name: Test on actual hardware
run: |
ls cmake-build/
python3 test/hil/hil_test.py ${{ env.HIL_JSON }} $SKIP_ARGS
# Skip boards that passed with previous run, file is generated by hil_test.py
SKIP_BOARDS=""
if [ -f ${{ env.HIL_JSON }}.skip ]; then
SKIP_BOARDS=$(cat "${HIL_JSON}.skip")
fi
echo "SKIP_BOARDS=$SKIP_BOARDS"
python3 test/hil/hil_test.py ${{ env.HIL_JSON }} $SKIP_BOARDS
# ---------------------------------------
# Hardware in the loop (HIL)