-
Notifications
You must be signed in to change notification settings - Fork 85
134 lines (134 loc) · 7.54 KB
/
pull-requests.yaml
File metadata and controls
134 lines (134 loc) · 7.54 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
{
"jobs": {
"build_and_test": {
"name": "build_and_test ${{ matrix.host.os }}",
"runs-on": "${{ matrix.host.os }}",
"steps": [
{
"name": "Check out source code",
"uses": "actions/checkout@v1"
},
{
"name": "Installing Bazel",
"run": "v=$(cat .bazelversion) && curl -L https://github.com/bazelbuild/bazel/releases/download/${v}/bazel-${v}-${{matrix.host.bazel_os}}-x86_64 > ~/bazel && chmod +x ~/bazel && echo ~ >> ${GITHUB_PATH}",
"shell": "bash"
},
{
"if": "matrix.host.platform_name == 'windows_amd64'",
"name": "Override .bazelrc",
"run": "echo \"startup --output_base=D:/bazel_output\" >> .bazelrc"
},
{
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'linux_amd64'",
"name": "linux_amd64: build${{ matrix.host.platform_name == 'linux_amd64' && ' and test' || '' }}",
"run": "bazel ${{ matrix.host.platform_name == 'linux_amd64' && 'test --test_output=errors' || 'build --platforms=@com_github_buildbarn_bb_storage//tools/platforms:linux_amd64 --@bazel_tools//tools/test:incompatible_use_default_test_toolchain=False' }} //..."
},
{
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'linux_amd64_v3'",
"name": "linux_amd64_v3: build${{ matrix.host.platform_name == 'linux_amd64_v3' && ' and test' || '' }}",
"run": "bazel ${{ matrix.host.platform_name == 'linux_amd64_v3' && 'test --test_output=errors' || 'build --platforms=@com_github_buildbarn_bb_storage//tools/platforms:linux_amd64_v3 --@bazel_tools//tools/test:incompatible_use_default_test_toolchain=False' }} //..."
},
{
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'linux_386'",
"name": "linux_386: build${{ matrix.host.platform_name == 'linux_amd64' && ' and test' || '' }}",
"run": "bazel ${{ matrix.host.platform_name == 'linux_amd64' && 'test --test_output=errors' || 'build --platforms=@com_github_buildbarn_bb_storage//tools/platforms:linux_386 --@bazel_tools//tools/test:incompatible_use_default_test_toolchain=False' }} //..."
},
{
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'linux_arm'",
"name": "linux_arm: build${{ matrix.host.platform_name == 'linux_arm' && ' and test' || '' }}",
"run": "bazel ${{ matrix.host.platform_name == 'linux_arm' && 'test --test_output=errors' || 'build --platforms=@com_github_buildbarn_bb_storage//tools/platforms:linux_arm --@bazel_tools//tools/test:incompatible_use_default_test_toolchain=False' }} //..."
},
{
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'linux_arm64'",
"name": "linux_arm64: build${{ matrix.host.platform_name == 'linux_arm64' && ' and test' || '' }}",
"run": "bazel ${{ matrix.host.platform_name == 'linux_arm64' && 'test --test_output=errors' || 'build --platforms=@com_github_buildbarn_bb_storage//tools/platforms:linux_arm64 --@bazel_tools//tools/test:incompatible_use_default_test_toolchain=False' }} //..."
},
{
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'darwin_amd64'",
"name": "darwin_amd64: build${{ matrix.host.platform_name == 'darwin_amd64' && ' and test' || '' }}",
"run": "bazel ${{ matrix.host.platform_name == 'darwin_amd64' && 'test --test_output=errors' || 'build --platforms=@com_github_buildbarn_bb_storage//tools/platforms:darwin_amd64 --@bazel_tools//tools/test:incompatible_use_default_test_toolchain=False' }} //..."
},
{
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'darwin_arm64'",
"name": "darwin_arm64: build${{ matrix.host.platform_name == 'darwin_arm64' && ' and test' || '' }}",
"run": "bazel ${{ matrix.host.platform_name == 'darwin_arm64' && 'test --test_output=errors' || 'build --platforms=@com_github_buildbarn_bb_storage//tools/platforms:darwin_arm64 --@bazel_tools//tools/test:incompatible_use_default_test_toolchain=False' }} //..."
},
{
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'freebsd_amd64'",
"name": "freebsd_amd64: build${{ matrix.host.platform_name == 'freebsd_amd64' && ' and test' || '' }}",
"run": "bazel ${{ matrix.host.platform_name == 'freebsd_amd64' && 'test --test_output=errors' || 'build --platforms=@com_github_buildbarn_bb_storage//tools/platforms:freebsd_amd64 --@bazel_tools//tools/test:incompatible_use_default_test_toolchain=False' }} //..."
},
{
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'windows_amd64'",
"name": "windows_amd64: build${{ matrix.host.platform_name == 'windows_amd64' && ' and test' || '' }}",
"run": "bazel ${{ matrix.host.platform_name == 'windows_amd64' && 'test --test_output=errors' || 'build --platforms=@com_github_buildbarn_bb_storage//tools/platforms:windows_amd64 --@bazel_tools//tools/test:incompatible_use_default_test_toolchain=False' }} //..."
},
{
"if": "matrix.host.platform_name == 'windows_amd64'",
"name": "Install WinFSP",
"run": "choco install winfsp"
},
{
"if": "matrix.host.platform_name == 'windows_amd64'",
"name": "Execute WinFSP Integration Tests",
"run": "bazel test //pkg/filesystem/virtual/winfsp:file_system_integration_test"
}
],
"strategy": {
"matrix": {
"host": [
{
"bazel_os": "linux",
"cross_compile": true,
"os": "ubuntu-latest",
"platform_name": "linux_amd64",
"upload": true
},
{
"bazel_os": "windows",
"cross_compile": false,
"os": "windows-latest",
"platform_name": "windows_amd64",
"upload": false
}
]
}
}
},
"lint": {
"name": "lint",
"runs-on": "ubuntu-latest",
"steps": [
{
"name": "Check out source code",
"uses": "actions/checkout@v1"
},
{
"name": "Installing Bazel",
"run": "v=$(cat .bazelversion) && curl -L https://github.com/bazelbuild/bazel/releases/download/${v}/bazel-${v}-linux-x86_64 > ~/bazel && chmod +x ~/bazel && echo ~ >> ${GITHUB_PATH}",
"shell": "bash"
},
{
"name": "Reformat",
"run": "bazel run @com_github_buildbarn_bb_storage//tools:reformat"
},
{
"name": "Test style conformance",
"run": "git add . && git diff --exit-code HEAD --"
},
{
"name": "Golint",
"run": "bazel run @org_golang_x_lint//golint -- -set_exit_status $(pwd)/..."
}
]
}
},
"name": "pull-requests",
"on": {
"pull_request": {
"branches": [
"main"
]
}
}
}