From e61912a14dde2f92944bfefe43a1e38e4dfeb160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Fri, 28 Aug 2020 13:55:48 +0200 Subject: [PATCH] ci: add Jenkinsfile.windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The host used to run this build is currently configured using: https://github.com/status-im/infra-ci/blob/dda93d9e/files/windows_setup_script.ps1 https://github.com/status-im/infra-ci/blob/dda93d9e/files/windows_startup_script.ps1 Signed-off-by: Jakub SokoĊ‚owski --- ci/Jenkinsfile.windows | 88 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 ci/Jenkinsfile.windows diff --git a/ci/Jenkinsfile.windows b/ci/Jenkinsfile.windows new file mode 100644 index 0000000000..1d64d7618b --- /dev/null +++ b/ci/Jenkinsfile.windows @@ -0,0 +1,88 @@ +library 'status-react-jenkins@v1.2.0' + +pipeline { + agent { label 'windows' } + + options { + timestamps() + /* Prevent Jenkins jobs from running forever */ + timeout(time: 25, unit: 'MINUTES') + /* manage how many builds we keep */ + buildDiscarder(logRotator( + numToKeepStr: '20', + daysToKeepStr: '60', + )) + } + + environment { + TARGET = 'windows' + /* Improve make performance */ + MAKEFLAGS = '-j4' + /* Disable colors in Nim compiler logs */ + NIMFLAGS = '--colors:off' + /* Makefile assumes the compiler folder is included */ + QTDIR = '/c/Qt/5.14.2/msvc2017_64' + Qt5_DIR = '/c/Qt/5.14.2/msvc2017_64' + VCINSTALLDIR = '/c/BuildTools/VC' + /* Control output the filename */ + STATUS_CLIENT_ZIP = "pkg/${utils.pkgFilename('zip')}" + /* Adjust path for correct access to build toos */ + PATH = [ + "${QTDIR}/bin", + '/c/ProgramData/scoop/apps/gcc/current/bin', + '/c/ProgramData/scoop/apps/git/current/bin', + '/c/ProgramData/scoop/apps/git/current/usr/bin', + '/c/BuildTools/MSBuild/Current/Bin', + '/c/BuildTools/VC/Tools/MSVC/14.27.29110/bin', + '/c/ProgramData/scoop/shims', + '/c/ProgramData/scoop/apps/pypy3/current/Scripts', + ].join(':') + } + + stages { + stage('Modules') { + steps { + /* avoid re-compiling Nim by using cache */ + cache(maxCacheSize: 250, caches: [[ + $class: 'ArbitraryFileCache', + includes: '**/*', + path: 'vendor/nimbus-build-system/vendor/Nim/bin' + ]]) { + sh 'make update' + } + } + } + + stage('Deps') { + steps { sh 'make deps' } + } + + stage('status-go') { + steps { sh 'make status-go' } + } + + stage('Package') { + steps { sh "make ${env.STATUS_CLIENT_ZIP}" } + } + + stage('Parallel Upload') { + parallel { + stage('Upload') { + steps { script { + env.PKG_URL = s3.uploadArtifact(env.STATUS_CLIENT_ZIP) + } } + } + stage('Archive') { + steps { script { + archiveArtifacts(env.STATUS_CLIENT_ZIP) + } } + } + } + } + } + post { + success { script { github.notifyPR(true) } } + failure { script { github.notifyPR(false) } } + always { cleanWs() } + } +}