forked from espressif/esp-idf
feat(tools): Add pytest build system on Windows runner
This commit is contained in:
@@ -550,6 +550,38 @@ pytest_build_system_macos:
|
|||||||
reports:
|
reports:
|
||||||
junit: XUNIT_RESULT.xml
|
junit: XUNIT_RESULT.xml
|
||||||
|
|
||||||
|
.test_build_system_template_win:
|
||||||
|
stage: host_test
|
||||||
|
variables:
|
||||||
|
# Enable ccache for all build jobs. See configure_ci_environment.sh for more ccache related settings.
|
||||||
|
IDF_CCACHE_ENABLE: "1"
|
||||||
|
PYTHONPATH: "$PYTHONPATH;$IDF_PATH\\tools;$IDF_PATH\\tools\\esp_app_trace;$IDF_PATH\\components\\partition_table;$IDF_PATH\\tools\\ci\\python_packages"
|
||||||
|
before_script: []
|
||||||
|
after_script: []
|
||||||
|
timeout: 4 hours
|
||||||
|
script:
|
||||||
|
- .\install.ps1 --enable-ci --enable-pytest
|
||||||
|
- . .\export.ps1
|
||||||
|
- python "${SUBMODULE_FETCH_TOOL}" -s "all"
|
||||||
|
- cd ${IDF_PATH}\tools\test_build_system
|
||||||
|
- pytest --junitxml=${CI_PROJECT_DIR}\XUNIT_RESULT.xml
|
||||||
|
|
||||||
|
pytest_build_system_win:
|
||||||
|
extends:
|
||||||
|
- .test_build_system_template_win
|
||||||
|
- .rules:test:windows_pytest_build_system
|
||||||
|
needs: []
|
||||||
|
tags:
|
||||||
|
- windows-target
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- XUNIT_RESULT.xml
|
||||||
|
- test_build_system
|
||||||
|
when: always
|
||||||
|
expire_in: 2 days
|
||||||
|
reports:
|
||||||
|
junit: XUNIT_RESULT.xml
|
||||||
|
|
||||||
build_docker:
|
build_docker:
|
||||||
extends:
|
extends:
|
||||||
- .before_script:minimal
|
- .before_script:minimal
|
||||||
|
@@ -175,6 +175,12 @@
|
|||||||
patterns:
|
patterns:
|
||||||
- submodule
|
- submodule
|
||||||
|
|
||||||
|
"test:windows_pytest_build_system":
|
||||||
|
labels:
|
||||||
|
- windows
|
||||||
|
specific_rules:
|
||||||
|
- if-schedule-test-build-system-windows
|
||||||
|
|
||||||
#################################
|
#################################
|
||||||
# Triggered Only By Labels Jobs #
|
# Triggered Only By Labels Jobs #
|
||||||
#################################
|
#################################
|
||||||
|
@@ -350,6 +350,9 @@
|
|||||||
.if-schedule: &if-schedule
|
.if-schedule: &if-schedule
|
||||||
if: '$CI_PIPELINE_SOURCE == "schedule"'
|
if: '$CI_PIPELINE_SOURCE == "schedule"'
|
||||||
|
|
||||||
|
.if-schedule-test-build-system-windows: &if-schedule-test-build-system-windows
|
||||||
|
if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_BUILD_SYSTEM_TEST_WIN == "true"'
|
||||||
|
|
||||||
.if-trigger: &if-trigger
|
.if-trigger: &if-trigger
|
||||||
if: '$CI_PIPELINE_SOURCE == "trigger"'
|
if: '$CI_PIPELINE_SOURCE == "trigger"'
|
||||||
|
|
||||||
@@ -561,6 +564,9 @@
|
|||||||
.if-label-target_test: &if-label-target_test
|
.if-label-target_test: &if-label-target_test
|
||||||
if: '$BOT_LABEL_TARGET_TEST || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*target_test(?:,[^,\n\r]+)*$/i'
|
if: '$BOT_LABEL_TARGET_TEST || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*target_test(?:,[^,\n\r]+)*$/i'
|
||||||
|
|
||||||
|
.if-label-windows: &if-label-windows
|
||||||
|
if: '$BOT_LABEL_WINDOWS || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*windows(?:,[^,\n\r]+)*$/i'
|
||||||
|
|
||||||
.rules:build:
|
.rules:build:
|
||||||
rules:
|
rules:
|
||||||
- <<: *if-revert-branch
|
- <<: *if-revert-branch
|
||||||
@@ -2574,3 +2580,13 @@
|
|||||||
- <<: *if-label-submodule
|
- <<: *if-label-submodule
|
||||||
- <<: *if-dev-push
|
- <<: *if-dev-push
|
||||||
changes: *patterns-submodule
|
changes: *patterns-submodule
|
||||||
|
|
||||||
|
.rules:test:windows_pytest_build_system:
|
||||||
|
rules:
|
||||||
|
- <<: *if-revert-branch
|
||||||
|
when: never
|
||||||
|
- <<: *if-protected
|
||||||
|
- <<: *if-label-build-only
|
||||||
|
when: never
|
||||||
|
- <<: *if-schedule-test-build-system-windows
|
||||||
|
- <<: *if-label-windows
|
||||||
|
@@ -4,6 +4,7 @@ import argparse
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
import tarfile
|
import tarfile
|
||||||
import tempfile
|
import tempfile
|
||||||
import time
|
import time
|
||||||
@@ -230,9 +231,19 @@ class Gitlab(object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def decompress_archive(path: str, destination: str) -> str:
|
def decompress_archive(path: str, destination: str) -> str:
|
||||||
with tarfile.open(path, 'r') as archive_file:
|
full_destination = os.path.abspath(destination)
|
||||||
root_name = archive_file.getnames()[0]
|
# By default max path lenght is set to 260 characters
|
||||||
archive_file.extractall(destination)
|
# Prefix `\\?\` extends it to 32,767 characters
|
||||||
|
if sys.platform == 'win32':
|
||||||
|
full_destination = '\\\\?\\' + full_destination
|
||||||
|
|
||||||
|
try:
|
||||||
|
with tarfile.open(path, 'r') as archive_file:
|
||||||
|
root_name = archive_file.getnames()[0]
|
||||||
|
archive_file.extractall(full_destination)
|
||||||
|
except tarfile.TarError as e:
|
||||||
|
logging.error(f'Error while decompressing archive {path}')
|
||||||
|
raise e
|
||||||
|
|
||||||
return os.path.join(os.path.realpath(destination), root_name)
|
return os.path.join(os.path.realpath(destination), root_name)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user