forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 61
/
do_ci.ps1
executable file
·69 lines (64 loc) · 1.84 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
58
59
60
61
62
63
64
65
66
67
68
69
$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) {
echo "running windows tests $test"
bazel $env:BAZEL_BASE_OPTIONS.Split(" ") test $env:BAZEL_BUILD_OPTIONS.Split(" ") -c $type --build_tests_only $test
} else {
echo "running all windows tests"
bazel $env:BAZEL_BASE_OPTIONS.Split(" ") test $env:BAZEL_BUILD_OPTIONS.Split(" ") -c $type "//test/..." --test_tag_filters=-skip_on_windows --build_tests_only --test_summary=terse --test_output=errors
}
exit $LASTEXITCODE
}
$action, $test = $args
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.release.test_only" {
echo "bazel release build with tests..."
bazel_test "opt" $test
}
"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.debug.test_only" {
echo "bazel debug build with tests..."
bazel_test "dbg" $test
}
"bazel.dev" {
echo "bazel fastbuild build with tests..."
bazel_binary_build "fastbuild"
bazel_test "fastbuild" $test
}
"bazel.dev.test_only" {
echo "bazel fastbuild build with tests..."
bazel_test "fastbuild" $test
}
default {
echo "unknown action: $action"
exit 1
}
}