Skip to content

CI migration #189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CI/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ MLFLAGS := $(MLFLAGS) -wait
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
MLPATH := /usr/local/MATLAB
MLPATH := /opt/MATLAB
endif
ifeq ($(UNAME_S),Darwin)
MLPATH := /Applications
Expand Down
4 changes: 3 additions & 1 deletion CI/scripts/synth_designs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ then
MLRELEASE=R2023b
fi

MLPATH=/usr/local/MATLAB
MLPATH=/opt/MATLAB

cd ../..
cp hdl/vendor/AnalogDevices/hdlcoder_board_customization.m test/hdlcoder_board_customization_local.m
Expand All @@ -19,7 +19,9 @@ export DISPLAY=:77
export SWT_GTK3=0
source /opt/Xilinx/Vivado/2022.2/settings64.sh
$MLPATH/$MLRELEASE/bin/matlab $MLFLAGS -r "cd('test');runSynthTests('$BOARD');"
EC=$?
pidof Xvfb
if [ $? -eq 0 ]; then
kill -9 `pidof Xvfb`
fi
exit $EC
4 changes: 3 additions & 1 deletion CI/scripts/targeting_designs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ then
fi
echo "Testing demo: $DEMO"

MLPATH=/usr/local/MATLAB
MLPATH=/opt/MATLAB

cd ../..
source /opt/Xilinx/Vivado/2022.2/settings64.sh
Expand All @@ -21,7 +21,9 @@ export DISPLAY=:77
export SWT_GTK3=0
source /opt/Xilinx/Vivado/2022.2/settings64.sh
$MLPATH/$MLRELEASE/bin/matlab $MLFLAGS -r "addpath(genpath('test'));addpath(genpath('deps'));runDemoTests('$DEMO');"
EC=$?
pidof Xvfb
if [ $? -eq 0 ]; then
kill -9 `pidof Xvfb`
fi
exit $EC
20 changes: 10 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@Library('tfc-lib') _
@Library('tfc-lib@adef-ci') _

flags = gitParseFlags()

dockerConfig = getDockerConfig(['MATLAB','Vivado'], matlabHSPro=false)
dockerConfig = getDockerConfig(['MATLAB','Vivado','Internal'], matlabHSPro=false)
dockerConfig.add("-e MLRELEASE=R2023b")
dockerHost = 'docker'

Expand Down Expand Up @@ -32,7 +32,7 @@ stage("Build Toolbox") {
}
}
if (branchName == 'hdl_2022_r2') {
stash includes: '**', name: 'builtSources', useDefaultExcludes: false
local_stash('builtSources')
archiveArtifacts artifacts: 'hdl/*', followSymlinks: false, allowEmptyArchive: true
}
}
Expand All @@ -55,7 +55,7 @@ cstage("HDL Tests", "", flags) {
branchName ->
withEnv(['BOARD='+branchName]) {
cstage("Source", branchName, flags) {
unstash "builtSources"
local_unstash('builtSources')
sh 'make -C ./CI/scripts test'
junit testResults: 'test/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true
Expand All @@ -69,7 +69,7 @@ cstage("HDL Tests", "", flags) {
}
*/
cstage("Installer", branchName, flags) {
unstash "builtSources"
local_unstash('builtSources')
sh 'rm -rf hdl'
sh 'make -C ./CI/scripts test_installer'
junit testResults: 'test/*.xml', allowEmptyResults: true
Expand All @@ -96,7 +96,7 @@ for (int i=0; i < demoNames.size(); i++) {
stage(demo) {
echo "Node: ${env.NODE_NAME}"
echo "Demo: ${env.DEMO}"
unstash "builtSources"
local_unstash('builtSources', '', false)
sh 'make -C ./CI/scripts test_targeting_demos'
junit testResults: 'test/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: 'test/*', followSymlinks: false, allowEmptyArchive: true
Expand All @@ -117,7 +117,7 @@ parallel deployments
node('baremetal') {
stage("NonHW Tests") {
stage("NonHW") {
unstash "builtSources"
local_unstash('builtSources', '', false)
sh 'make -C ./CI/scripts run_NonHWTests'
}
}
Expand All @@ -132,7 +132,7 @@ cstage("Build Deployable Apps", "", flags) {
branchName ->
withEnv(['APP='+branchName]) {
cstage("Build DApps", branchName, flags) {
unstash "builtSources"
local_unstash('builtSources')
sh 'make -C ./CI/scripts ${APP}'
archiveArtifacts artifacts: 'trx_examples/streaming/LTE_PA_App/LTEPAinstaller/*.exe', followSymlinks: false, allowEmptyArchive: true
archiveArtifacts artifacts: 'trx_examples/streaming/LTE_PA_App/LTEPAinstaller/*.install', followSymlinks: false, allowEmptyArchive: true
Expand All @@ -149,7 +149,7 @@ cstage("Hardware Streaming Tests", "", flags) {
dockerParallelBuild(classNames, dockerHost, dockerConfig) {
branchName ->
withEnv(['HW='+branchName]) {
unstash "builtSources"
local_unstash("builtSources")
sh 'echo ${HW}'
// sh 'make -C ./CI/scripts test_streaming'
}
Expand All @@ -160,7 +160,7 @@ cstage("Hardware Streaming Tests", "", flags) {

node('baremetal || lab_b5') {
cstage('Deploy Development', "", flags) {
unstash "builtSources"
local_unstash("builtSources", '', false)
uploadArtifactory('TransceiverToolbox','*.mltbx')
}
}
Expand Down
18 changes: 18 additions & 0 deletions test/DemoTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
end

methods(TestClassSetup)
function refreshCache(~)
% Weird bug sometimes when MATLAB installed by mpm
Advisor.Manager.refresh_customizations;
rehash toolboxcache

end
function addpaths(testCase)
here = mfilename('fullpath');
here = strsplit(here,'/');
Expand Down Expand Up @@ -46,6 +52,18 @@ function buildHDLFrequencyHopper(testCase)
function buildHDLTuneAGC(testCase)
testCase.setupVivado('2022.2');
cd(fullfile(testCase.root,'trx_examples/targeting/tuneAGC-ad9361'));
% Get dependent scripts from example
if ~usejava('desktop')
setenv('EDITOR', 'cat');
end
here = pwd;
matlab.internal.language.introspective.openExample('comm/WINNERVHTMUMIMOExample', 'helperNoiseEstimate');
here = mfilename('fullpath');
here = strsplit(here,filesep);
root = fullfile(filesep,here{1:end-2});
here = fullfile(root, 'trx_examples' , 'targeting', 'tuneAGC-ad9361');
copyfile("helperNoiseEstimate.m",here);
cd(here);
hdlworkflow;
if ~isempty(out)
disp(out.message);
Expand Down
2 changes: 1 addition & 1 deletion test/runDemoTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


try
runner = matlab.unittest.TestRunner.withTextOutput('OutputDetail',1);
runner = matlab.unittest.TestRunner.withTextOutput('OutputDetail',4);
runner.addPlugin(DiagnosticsValidationPlugin)

xmlFile = 'BSPDemoTests.xml';
Expand Down
4 changes: 2 additions & 2 deletions trx_examples/targeting/frequency-hopping/build_kernel.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash

# Build kernel
git clone -b 2022_r2 --depth=1 https://github.com/analogdevicesinc/linux.git
git clone -b 2022_r2_release --depth=1 https://github.com/analogdevicesinc/linux.git
cd linux
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
source /opt/Xilinx/Vivado/2021.2/settings64.sh
source /opt/Xilinx/Vivado/2022.2/settings64.sh
cp ../hopper.patch .
git apply --reject hopper.patch
if [ "$?" != "0" ]; then
Expand Down
Binary file not shown.
Loading