Add mac/amd64 & linux/arm64 builders (#2349)

* Add mac/amd64 build

* Set arch requirements for all builds

* Add linux/arm64 build
This commit is contained in:
nd 2021-02-23 11:16:23 +01:00 committed by GitHub
parent d739cb04e3
commit baa580b626
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 49 additions and 1 deletions

@ -4,6 +4,7 @@ import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.commitStatusPu
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.golang
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.pullRequests
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.dockerCommand
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.exec
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.powerShell
import jetbrains.buildServer.configs.kotlin.v2019_2.failureConditions.BuildFailureOnMetric
import jetbrains.buildServer.configs.kotlin.v2019_2.failureConditions.failOnMetricChange
@ -41,8 +42,12 @@ val targets = arrayOf(
"linux/386/1.16",
"linux/arm64/1.16",
"windows/amd64/1.16",
"windows/amd64/tip"
"windows/amd64/tip",
"mac/amd64/1.16",
)
project {
@ -181,10 +186,21 @@ class TestBuild(val os: String, val arch: String, version: String, buildId: Abso
param("jetbrains_powershell_scriptArguments", "-version ${"go$version"} -arch $arch")
}
}
"mac" -> {
exec {
name = "Test"
path = "_scripts/tests_mac.sh"
arguments = "${"go$version"} $arch %system.teamcity.build.tempDir%"
}
}
}
}
requirements {
when (arch) {
"amd64" -> equals("teamcity.agent.jvm.os.arch", if (os == "mac") "x86_64" else "amd64")
"arm64" -> equals("teamcity.agent.jvm.os.arch", "aarch64")
}
when (os) {
"linux" -> {
matches("teamcity.agent.jvm.os.family", "Linux")
@ -192,6 +208,9 @@ class TestBuild(val os: String, val arch: String, version: String, buildId: Abso
"windows" -> {
matches("teamcity.agent.jvm.os.family", "Windows")
}
"mac" -> {
matches("teamcity.agent.jvm.os.family", "Mac OS")
}
}
}

29
_scripts/test_mac.sh Normal file

@ -0,0 +1,29 @@
#!/bin/bash
set -x
set -e
GOVERSION=$1
ARCH=$2
TMPDIR=$3
if [ "$GOVERSION" = "gotip" ]; then
git clone https://go.googlesource.com/go $TMPDIR/go
export GOROOT_BOOTSTRAP=$GOROOT
cd $TMPDIR/go/src
./make.bash
cd -
else
cd $TMPDIR
curl -sSL "https://storage.googleapis.com/golang/go$GOVERSION.darwin-$ARCH.tar.gz" | tar -vxz
cd -
fi
mkdir -p $TMPDIR/gopath
export GOROOT="$TMPDIR/go"
export GOPATH="$TMPDIR/gopath"
export GOARCH="$ARCH"
export PATH="$GOROOT/bin:$PATH"
make test