forked from git-lfs/git-lfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcibuild
More file actions
executable file
·55 lines (43 loc) · 1.46 KB
/
cibuild
File metadata and controls
executable file
·55 lines (43 loc) · 1.46 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
#!/usr/bin/env bash
set -e
# Strip out CI environment variables which cause tests to fail.
unset $(env | grep -E '^GIT(HUB)?_' | grep -v '^GIT_DEFAULT_HASH=' | sed -e 's/=.*$//')
UNAME=$(uname -s)
X=""
if [[ $UNAME == MINGW* || $UNAME == MSYS* || $UNAME == CYGWIN* ]]; then
X=".exe"
WINDOWS=1
export GIT_LFS_NO_TEST_COUNT=1
export GIT_LFS_LOCK_ACQUIRE_DISABLED=1
fi
# Build git-lfs-transfer from scutiger.
cargo install --root t/scutiger scutiger-lfs
# Set GOPATH if it isn't already set.
eval "$(go env | grep GOPATH)"
go install golang.org/x/tools/cmd/goimports@latest
GOIMPORTS="$GOPATH/bin/goimports"
make GOIMPORTS="$GOIMPORTS" && make GOIMPORTS="$GOIMPORTS" test
# re-run test to ensure GIT_TRACE output doesn't leak into the git package
GIT_TRACE=1 make GOIMPORTS="$GOIMPORTS" PKGS=git test
pushd t >/dev/null
PROVE="prove"
PROVE_EXTRA_ARGS="-j9"
if [ "$WINDOWS" ]; then
export PATH="/c/Strawberry/perl/bin:.:$PATH"
PROVE="prove.bat"
PROVE_EXTRA_ARGS="$PROVE_EXTRA_ARGS --exec bash"
fi
VERBOSE_LOGS=1 make X="$X" clean
VERBOSE_LOGS=1 make X="$X" PROVE="$PROVE" PROVE_EXTRA_ARGS="$PROVE_EXTRA_ARGS"
popd >/dev/null
echo "Looking for trailing whitespace..."
if git grep -lE '[[:space:]]+$' | \
grep -vE '(^vendor/|\.git/(objects/|index)|\.(bat|ico|bmp)$)'
then
exit 1
fi
echo "Formatting files..."
make GOIMPORTS="$GOIMPORTS" fmt
echo "Looking for files that are not formatted correctly..."
git status -s
[ -z "$(git status --porcelain)" ]