From 9cb697f5de7fca487f5bbc0ee442cf32e46cdad1 Mon Sep 17 00:00:00 2001 From: Sam Chesney Date: Tue, 20 Aug 2019 13:03:45 +0100 Subject: [PATCH 1/5] Update Jenkins Pipeline to use new agents --- .gitignore | 1 + Brewfile | 7 +++++++ Jenkinsfile | 59 ++++++++++++++++++++++++++++++++++++++++++----------- Pipfile | 7 +++++++ cpanfile | 2 ++ 5 files changed, 64 insertions(+), 12 deletions(-) create mode 100644 Brewfile create mode 100644 Pipfile create mode 100644 cpanfile diff --git a/.gitignore b/.gitignore index e7e76877..d38743a7 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ .DS_Store test_results.csv _build* +**/.venv/** # waf build files .lock-waf_* diff --git a/Brewfile b/Brewfile new file mode 100644 index 00000000..2fd6d0b8 --- /dev/null +++ b/Brewfile @@ -0,0 +1,7 @@ +tap 'homebrew/core' + +brew 'perl' +brew 'cpanm' + +brew 'python@2' +brew 'pipenv' diff --git a/Jenkinsfile b/Jenkinsfile index f2e9dbad..53498dbe 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,11 +1,52 @@ -@Library('xmos_jenkins_shared_library@master') _ +@Library('xmos_jenkins_shared_library@develop') _ + +getApproval() + pipeline { agent { - label 'x86&&macOS&&Apps' + label 'x86_64&&brew&&macOS' } environment { - VIEW = 'xua' REPO = 'lib_xua' + VIEW = "${env.JOB_NAME.contains('PR-') ? REPO+'_'+env.CHANGE_TARGET : REPO+'_'+env.BRANCH_NAME}" + } + triggers { + /* Trigger this Pipeline on changes to the repos dependencies + * + * If this Pipeline is running in a pull request, the triggers are set + * on the base branch the PR is set to merge in to. + * + * Otherwise the triggers are set on the branch of a matching name to the + * one this Pipeline is on. + */ + upstream( + upstreamProjects: + (env.JOB_NAME.contains('PR-') ? + "../lib_device_control/${env.CHANGE_TARGET}," + + "../lib_dsp/${env.CHANGE_TARGET}," + + "../lib_i2c/${env.CHANGE_TARGET}," + + "../lib_logging/${env.CHANGE_TARGET}," + + "../lib_mic_array/${env.CHANGE_TARGET}," + + "../lib_spdif/${env.CHANGE_TARGET}," + + "../lib_xassert/${env.CHANGE_TARGET}," + + "../lib_xud/${env.CHANGE_TARGET}," + + "../tools_released/${env.CHANGE_TARGET}," + + "../tools_xmostest/${env.CHANGE_TARGET}," + + "../xdoc_released/${env.CHANGE_TARGET}" + : + "../lib_device_control/${env.BRANCH_NAME}," + + "../lib_dsp/${env.BRANCH_NAME}," + + "../lib_i2c/${env.BRANCH_NAME}," + + "../lib_logging/${env.BRANCH_NAME}," + + "../lib_mic_array/${env.BRANCH_NAME}," + + "../lib_spdif/${env.BRANCH_NAME}," + + "../lib_xassert/${env.BRANCH_NAME}," + + "../lib_xud/${env.BRANCH_NAME}," + + "../tools_released/${env.BRANCH_NAME}," + + "../tools_xmostest/${env.BRANCH_NAME}," + + "../xdoc_released/${env.BRANCH_NAME}"), + threshold: hudson.model.Result.SUCCESS + ) } options { skipDefaultCheckout() @@ -13,7 +54,7 @@ pipeline { stages { stage('Get view') { steps { - prepareAppsSandbox("${VIEW}", "${REPO}") + xcorePrepareSandbox("${VIEW}", "${REPO}") } } stage('Library checks') { @@ -28,14 +69,8 @@ pipeline { } stage('Host builds') { steps { - dir("${REPO}") { - dir("${REPO}") { - dir('host') { - dir('xmosdfu') { - sh 'make -f Makefile.OSX64' - } - } - } + dir("${REPO}/${REPO}/host/xmosdfu") { + sh 'make -f Makefile.OSX64' } } } diff --git a/Pipfile b/Pipfile new file mode 100644 index 00000000..6d52bfd2 --- /dev/null +++ b/Pipfile @@ -0,0 +1,7 @@ +[[source]] +name = "pypi" +url = "https://pypi.org/simple" +verify_ssl = true + +[dev-packages] +flake8 = "*" diff --git a/cpanfile b/cpanfile new file mode 100644 index 00000000..071f5e6a --- /dev/null +++ b/cpanfile @@ -0,0 +1,2 @@ +requires 'File::Copy::Recursive'; +requires 'LWP::Simple' From 344d87342ca0f3c6b85d4ffe1138e60fa8f89398 Mon Sep 17 00:00:00 2001 From: Sam Chesney Date: Tue, 20 Aug 2019 13:17:06 +0100 Subject: [PATCH 2/5] Build host apps on both Linux and macOS --- Jenkinsfile | 111 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 78 insertions(+), 33 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 53498dbe..5e404793 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,9 +3,7 @@ getApproval() pipeline { - agent { - label 'x86_64&&brew&&macOS' - } + agent none environment { REPO = 'lib_xua' VIEW = "${env.JOB_NAME.contains('PR-') ? REPO+'_'+env.CHANGE_TARGET : REPO+'_'+env.BRANCH_NAME}" @@ -52,45 +50,92 @@ pipeline { skipDefaultCheckout() } stages { - stage('Get view') { - steps { - xcorePrepareSandbox("${VIEW}", "${REPO}") + stage('Basic tests') { + agent { + label 'x86_64&&brew' } - } - stage('Library checks') { - steps { - xcoreLibraryChecks("${REPO}") + stages { + stage('Get view') { + steps { + xcorePrepareSandbox("${VIEW}", "${REPO}") + } + } + stage('Library checks') { + steps { + xcoreLibraryChecks("${REPO}") + } + } + stage('Tests') { + steps { + runXmostest("${REPO}", 'tests') + } + } + stage('xCORE builds') { + steps { + dir("${REPO}") { + xcoreAllAppNotesBuild('examples') + dir("${REPO}") { + runXdoc('doc') + } + } + } + } } - } - stage('Tests') { - steps { - runXmostest("${REPO}", 'tests') - } - } - stage('Host builds') { - steps { - dir("${REPO}/${REPO}/host/xmosdfu") { - sh 'make -f Makefile.OSX64' + post { + cleanup { + xcoreCleanSandbox() } } } - stage('xCORE builds') { - steps { - dir("${REPO}") { - xcoreAllAppNotesBuild('examples') - dir("${REPO}") { - runXdoc('doc') + stage('Build host apps') { + failFast true + parallel { + stage('Build Linux host app') { + agent { + label 'x86_64&&brew&&linux' + } + steps { + xcorePrepareSandbox("${VIEW}", "${REPO}") + dir("${REPO}/${REPO}/host/xmosdfu") { + sh 'make -f Makefile.Linux64' + } + } + post { + cleanup { + xcoreCleanSandbox() + } + } + } + stage('Build Mac host app') { + agent { + label 'x86_64&&brew&&macOS' + } + steps { + xcorePrepareSandbox("${VIEW}", "${REPO}") + dir("${REPO}/${REPO}/host/xmosdfu") { + sh 'make -f Makefile.OSX64' + } + } + post { + cleanup { + xcoreCleanSandbox() + } } } } } - } - post { - success { - updateViewfiles() - } - cleanup { - cleanWs() + stage('Update') { + agent { + label 'x86_64&&brew' + } + steps { + updateViewfiles() + } + post { + cleanup { + cleanWs() + } + } } } } From 636803d5d4cbc9fd00ea1704c2aa2c5c23ca1480 Mon Sep 17 00:00:00 2001 From: Sam Chesney Date: Tue, 20 Aug 2019 18:49:45 +0100 Subject: [PATCH 3/5] Update dependency info in release notes --- CHANGELOG.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a5b83a91..b021b965 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -15,13 +15,13 @@ lib_xua Change Log * RESOLVED: wChannelConfig in UAC1 descriptor set according to output channel count * RESOLVED: Indexing of ADAT channel strings (#18059) - * RESOLVED: Rebooting device fails when PLL config "not reset" bit is set + * RESOLVED: Rebooting device fails when PLL config "not reset" bit is set * Changes to dependencies: - - lib_spdif: Added dependency 3.0.0 + - lib_spdif: Added dependency 3.1.0 - - lib_xassert: Added dependency 3.0.1 + - lib_xassert: Added dependency 4.0.0 0.1.2 ----- From 40f4c2f8abbda711ee79e6b20136e6046cedd400 Mon Sep 17 00:00:00 2001 From: Sam Chesney Date: Tue, 20 Aug 2019 18:50:25 +0100 Subject: [PATCH 4/5] Update copyright date --- lib_xua/src/core/endpoint0/xua_ep0_descriptors.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h index 0a84d4ee..4c85c56c 100644 --- a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h +++ b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2018, XMOS Ltd, All rights reserved +// Copyright (c) 2011-2019, XMOS Ltd, All rights reserved /** * @file xua_ep0_descriptors.h * @brief Device Descriptors From 204c695434c56b886a3f637db0c776fa8d151f50 Mon Sep 17 00:00:00 2001 From: Sam Chesney Date: Tue, 20 Aug 2019 19:02:53 +0100 Subject: [PATCH 5/5] Correct dependency info in release notes --- CHANGELOG.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b021b965..232e19a7 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -21,7 +21,7 @@ lib_xua Change Log - lib_spdif: Added dependency 3.1.0 - - lib_xassert: Added dependency 4.0.0 + - lib_xassert: Added dependency 3.0.1 0.1.2 ----- @@ -95,7 +95,7 @@ Legacy release history 7.3.0 ----- - - CHANGE: Example OSX DFU host app updated to now take PID as runtime + - CHANGE: Example OSX DFU host app updated to now take PID as runtime argument. This enabled multiple XMOS devices to be attached to the host during DFU process