forked from envoyproxy/envoy-wasm
-
Notifications
You must be signed in to change notification settings - Fork 1
/
do_ci.ps1
executable file
·57 lines (52 loc) · 1.4 KB
/
do_ci.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
$ErrorActionPreference = "Stop";
trap { $host.SetShouldExit(1) }
. "$PSScriptRoot\build_setup.ps1"
Write-Host "building using $env:NUM_CPUS CPUs"
function bazel_binary_build($type) {
echo "Building..."
bazel $env:BAZEL_BASE_OPTIONS.Split(" ") build $env:BAZEL_BUILD_OPTIONS.Split(" ") -c $type "//source/exe:envoy-static"
$exit = $LASTEXITCODE
if ($exit -ne 0) {
exit $exit
}
}
function bazel_test($type, $test) {
if ($test -ne "") {
bazel $env:BAZEL_BASE_OPTIONS.Split(" ") test $env:BAZEL_TEST_OPTIONS.Split(" ") -c $type $test
} else {
echo "running windows tests"
bazel $env:BAZEL_BASE_OPTIONS.Split(" ") test $env:BAZEL_TEST_OPTIONS.Split(" ") -c $type "//test/..."
}
exit $LASTEXITCODE
}
$action = $args[0]
$test = $args[1]
switch ($action) {
"bazel.release" {
echo "bazel release build with tests..."
bazel_binary_build "opt"
bazel_test "opt" "$test"
}
"bazel.release.server_only" {
echo "bazel release build..."
bazel_binary_build "opt"
}
"bazel.debug" {
echo "bazel debug build with tests..."
bazel_binary_build "dbg"
bazel_test "dbg" "$test"
}
"bazel.debug.server_only" {
echo "bazel debug build..."
bazel_binary_build "dbg"
}
"bazel.dev" {
echo "bazel fastbuild build with tests..."
bazel_binary_build "fastbuild"
bazel_test "fastbuild" "$test"
}
default {
echo "unknown action: $action"
exit 1
}
}