Skip to content
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

Test x86 mac #15

Draft
wants to merge 31 commits into
base: master
Choose a base branch
from
Draft
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
3 changes: 3 additions & 0 deletions Dockerfile.llvm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM ubuntu:18.04

RUN apt-get update && apt-get install -y xz-utils wget git
80 changes: 80 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!groovy

/**
* This Jenkinsfile will only work in a Swift Navigation build/CI environment, as it uses
* non-public docker images and pipeline libraries.
*/

// Use 'ci-jenkins@somebranch' to pull shared lib from a different branch than the default.
// Default is configured in Jenkins and should be from "stable" tag.
@Library("ci-jenkins") import com.swiftnav.ci.*

def context = new Context(context: this)
context.setRepo("swift-toolchains")

/**
* - Mount the refrepo to keep git operations functional on a repo that uses ref-repo during clone
**/
String dockerMountArgs = "-v /mnt/efs/refrepo:/mnt/efs/refrepo"

pipeline {
// Override agent in each stage to make sure we don't share containers among stages.
agent any
options {
// Make sure job aborts after 2 hours if hanging.
timeout(time: 4, unit: 'HOURS')
timestamps()
// Keep builds for 7 days.
buildDiscarder(logRotator(daysToKeepStr: '7'))
}

stages {
stage('Build') {
parallel {
stage('llvm x86_64 darwin') {
agent {
dockerfile {
filename "Dockerfile.llvm"
}
}
steps {
sh('''
wget -qO- https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-apple-darwin.tar.xz | tar xfJ -

find clang+llvm-14.0.0-x86_64-apple-darwin/bin/* \
! -name 'clang' ! -name 'clang++' ! -name 'clang-14' ! -name 'clang-cl' ! -name 'clang-cpp' \
! -name 'ld64.lld' ! -name 'ld.lld' ! -name 'lld' ! -name 'lld-link' \
! -name 'llvm-ar' ! -name 'llvm-as' ! -name 'llvm-nm' ! -name 'llvm-objdump' ! -name 'llvm-objcopy' \
! -name 'llvm-profdata' ! -name 'llvm-dwp' ! -name 'llvm-ranlib' ! -name 'llvm-readelf' ! -name 'llvm-readobj' \
! -name 'llvm-strip' ! -name 'llvm-symbolizer' ! -name 'llvm-cov' \
! -name 'clang-tidy' ! -name 'clang-format' \
-exec rm {} +

find clang+llvm-14.0.0-x86_64-apple-darwin/lib/ -maxdepth 1 -type f,l -exec rm {} +
''')
uploadDistribution("clang+llvm-14.0.0-x86_64-apple-darwin", context)
}
}
}
}
}
}

def uploadDistribution(name, context) {
sh("tar -czf ${name}.tar.gz ${name}/")
sh("sha256sum '${name}.tar.gz' > ${name}.tar.gz.sha256")
archiveArtifacts artifacts: '*.tar.gz*'

script{
context.archivePatterns(
patterns: ["${name}.tar.gz"],
path: "swift-toolchains/${context.gitDescribe()}/${name}.tar.gz",
jenkins: false
)
context.archivePatterns(
patterns: ["${name}.tar.gz.sha256"],
path: "swift-toolchains/${context.gitDescribe()}/${name}.tar.gz.sha256",
jenkins: false
)
}
}