mirror of
https://github.com/espressif/arduino-esp32.git
synced 2026-03-13 09:41:48 +08:00
72 lines
2.2 KiB
YAML
72 lines
2.2 KiB
YAML
########################
|
|
# HW Test Job Template #
|
|
########################
|
|
|
|
# This template is used to generate the pipeline for each hardware test.
|
|
# It is triggered in hardware_tests_dynamic.yml after being generated by gen_hw_jobs.py.
|
|
|
|
include:
|
|
- local: ".gitlab/workflows/common.yml"
|
|
|
|
# Single job template to be cloned by the dynamic generator
|
|
hw-test-template:
|
|
stage: test
|
|
image: python:3.12-bookworm
|
|
timeout: 5h
|
|
|
|
rules:
|
|
- when: on_success
|
|
|
|
variables:
|
|
RUNNER_SCRIPT_TIMEOUT: 4h
|
|
DEBIAN_FRONTEND: "noninteractive"
|
|
TEST_TYPE: $TEST_TYPE
|
|
TEST_CHIP: $TEST_CHIP
|
|
PIPELINE_ID: $PIPELINE_ID
|
|
BINARIES_RUN_ID: $BINARIES_RUN_ID
|
|
GITHUB_REPOSITORY: $GITHUB_REPOSITORY
|
|
GITHUB_REF: $GITHUB_REF
|
|
GIT_STRATEGY: clone
|
|
|
|
tags:
|
|
- $TEST_CHIP
|
|
|
|
before_script:
|
|
- echo "Running hardware tests for chip:$TEST_CHIP type:$TEST_TYPE"
|
|
- echo "Pipeline ID:$PIPELINE_ID"
|
|
- echo "Fetching ref $GITHUB_REF from GitHub:$GITHUB_REPOSITORY"
|
|
- REF_NAME=$(echo "$GITHUB_REF" | sed 's|refs/heads/||; s|refs/tags/||')
|
|
- git config --global http.version HTTP/1.1
|
|
- git config --global http.lowSpeedLimit 0
|
|
- git config --global http.lowSpeedTime 999999
|
|
- git fetch origin "$REF_NAME" --depth 1
|
|
- git checkout FETCH_HEAD
|
|
- bash .gitlab/scripts/install_dependencies.sh
|
|
- rm -rf ~/.arduino/tests
|
|
- mkdir -p ~/.arduino/tests/$TEST_CHIP
|
|
- echo Fetching binaries for $TEST_CHIP $TEST_TYPE
|
|
- bash .gitlab/scripts/get_artifacts.sh
|
|
- pip install -r tests/requirements.txt --extra-index-url https://dl.espressif.com/pypi
|
|
|
|
script:
|
|
- echo "Using binaries for $TEST_CHIP"
|
|
- |
|
|
set -e
|
|
rc=0
|
|
while IFS= read -r d; do
|
|
[ -z "$d" ] && continue;
|
|
sketch=$(basename "$d");
|
|
echo Running $sketch in $d;
|
|
bash .github/scripts/tests_run.sh -t "$TEST_CHIP" -s "$sketch" -e -wifi-ssid "$RUNNER_WIFI_SSID" -wifi-password "$RUNNER_WIFI_PASSWORD" || rc=$?;
|
|
done <<< "$TEST_LIST"; exit $rc
|
|
|
|
artifacts:
|
|
name: "hw-test-results-$TEST_CHIP-$TEST_TYPE"
|
|
expire_in: 7 days
|
|
when: always
|
|
paths:
|
|
- "tests/**/*.xml"
|
|
- "tests/**/result_*.json"
|
|
reports:
|
|
junit: "tests/**/*.xml"
|