1
0
mirror of https://github.com/azure-rtos/threadx synced 2025-01-16 07:42:57 +08:00

Add Azure DevOps pipelines for ThreadX test

This commit is contained in:
Tiejun Zhou 2023-04-11 07:36:09 +00:00
parent ebeb02b958
commit 5f430f22e2
6 changed files with 161 additions and 2 deletions

59
.pipelines/smp.yml Normal file
View File

@ -0,0 +1,59 @@
trigger:
- master
pr:
- master
pool:
vmImage: "ubuntu-22.04"
steps:
- bash: sudo $(Build.SourcesDirectory)/scripts/install.sh
displayName: 'Install softwares'
env:
INDEX_URL: $(INDEX_URL)
- task: Bash@3
displayName: 'SDL check'
inputs:
filePath: '$(Build.SourcesDirectory)/scripts/sdl_check.sh'
- task: Bash@3
displayName: 'Build SMP'
inputs:
filePath: '$(Build.SourcesDirectory)/scripts/build_smp.sh'
- task: Bash@3
displayName: 'Test SMP'
inputs:
filePath: '$(Build.SourcesDirectory)/scripts/test_smp.sh'
- task: PublishTestResults@2
condition: succeededOrFailed()
displayName: 'Test SMP (PublishTestResults)'
inputs:
testResultsFormat: 'cTest'
testResultsFiles: '*/Testing/**/*.xml'
searchFolder: '$(Build.SourcesDirectory)/test/smp/cmake/build'
testRunTitle: 'SMP-Tests'
buildConfiguration: 'Release'
- task: CopyFiles@2
condition: succeededOrFailed()
displayName: 'Test SMP (PublishTestReports)'
inputs:
SourceFolder: '$(Build.SourcesDirectory)/test/smp/cmake'
Contents: |
build/*.txt
build/*/Testing/**/*.xml
coverage_report/**/*
TargetFolder: '$(ob_outputDirectory)/test_reports_SMP'
- task: PublishCodeCoverageResults@1
condition: succeededOrFailed()
displayName: 'Test SMP (PublishCodeCoverageResults)'
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: '$(Build.SourcesDirectory)/test/smp/cmake/coverage_report/default_build_coverage.xml'
pathToSources: '$(Build.SourcesDirectory)/test/smp/cmake'
reportDirectory: '$(Build.SourcesDirectory)/test/smp/cmake/coverage_report/default_build_coverage'

59
.pipelines/tx.yml Normal file
View File

@ -0,0 +1,59 @@
trigger:
- master
pr:
- master
pool:
vmImage: "ubuntu-22.04"
steps:
- bash: sudo $(Build.SourcesDirectory)/scripts/install.sh
displayName: 'Install softwares'
env:
INDEX_URL: $(INDEX_URL)
- task: Bash@3
displayName: 'SDL check'
inputs:
filePath: '$(Build.SourcesDirectory)/scripts/sdl_check.sh'
- task: Bash@3
displayName: 'Build TX'
inputs:
filePath: '$(Build.SourcesDirectory)/scripts/build_tx.sh'
- task: Bash@3
displayName: 'Test TX'
inputs:
filePath: '$(Build.SourcesDirectory)/scripts/test_tx.sh'
- task: PublishTestResults@2
condition: succeededOrFailed()
displayName: 'Test TX (PublishTestResults)'
inputs:
testResultsFormat: 'cTest'
testResultsFiles: '*/Testing/**/*.xml'
searchFolder: '$(Build.SourcesDirectory)/test/tx/cmake/build'
testRunTitle: 'TX-Tests'
buildConfiguration: 'Release'
- task: CopyFiles@2
condition: succeededOrFailed()
displayName: 'Test TX (PublishTestReports)'
inputs:
SourceFolder: '$(Build.SourcesDirectory)/test/tx/cmake'
Contents: |
build/*.txt
build/*/Testing/**/*.xml
coverage_report/**/*
TargetFolder: '$(ob_outputDirectory)/test_reports_TX'
- task: PublishCodeCoverageResults@1
condition: succeededOrFailed()
displayName: 'Test TX (PublishCodeCoverageResults)'
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: '$(Build.SourcesDirectory)/test/tx/cmake/coverage_report/default_build_coverage.xml'
pathToSources: '$(Build.SourcesDirectory)/test/tx/cmake'
reportDirectory: '$(Build.SourcesDirectory)/test/tx/cmake/coverage_report/default_build_coverage'

22
scripts/install.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
#
# Install necessary softwares for Ubuntu.
apt-get update
apt-get install -y \
gcc-multilib \
git \
g++ \
python3-pip \
ninja-build \
unifdef \
p7zip-full \
tofrodos \
gawk \
cmake \
software-properties-common
python3 -m pip install --upgrade pip
pip3 install artifacts-keyring
pip3 install gcovr==4.1 $INDEX_URL

19
scripts/sdl_check.sh Executable file
View File

@ -0,0 +1,19 @@
# !/bin/bash
dir_list="common common_smp common_modules ports ports_module ports_smp samples"
exclude_list="-path TX"
file_list=$(find $dir_list \( $exclude_list \) -prune -o -type f -name '*.[ch]' -print)
cd $(dirname `realpath $0`)/..
echo "Checking for unexpected usage of memcpy..."
echo ""
echo "Excluding:"
echo $exclude_list | grep -P "[^\s]*/[^\s]*" -o
echo ""
echo "Result:"
grep -i "memcpy(" -i $file_list -n | grep -i "use case of .* is verified" -v
if [ "$?" -eq "1" ];
then
echo "CLEAN"
exit 0
else
exit 1
fi

View File

@ -1 +1 @@
../../../tools/cmake_bootstrap.sh
../../../scripts/cmake_bootstrap.sh

View File

@ -1 +1 @@
../../../tools/cmake_bootstrap.sh
../../../scripts/cmake_bootstrap.sh