Skip to content

Commit 1df33a4

Browse files
committed
build(travis): improve lint script
1 parent c7286ed commit 1df33a4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,15 @@ before_script:
1313
- chmod +x ./tusd_linux_amd64/tusd
1414

1515
script:
16+
# lint
17+
- 'export COMMITS=$(git log -50 --oneline --pretty="%s" --no-merges --grep "skip" --grep "Revert" --invert-grep ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH} --)'
18+
- 'export FILTERED=$(echo -e "$COMMITS" | grep -E "^(build|docs|chore|feat|fix|infra|perf|rebase|refactor|release|revert|style|test)(\(\w+\))?: [a-z].+")'
19+
- 'echo -e "$COMMITS" > .commits && echo -e "$FILTERED" > .filtered'
20+
- '[ "${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" != "master" ] && diff .commits .filtered'
21+
# upload
1622
- './tusd_linux_amd64/tusd --upload-dir ~/.tusd-data --base-path /tus/ > /dev/null 2>&1 &'
1723
- './tusc.sh -H 0:1080 -f tusd_linux_amd64.tar.gz -a sha256 -b /tus/'
24+
# download and verify
1825
- 'URL=$(./tusc.sh -H 0:1080 -f tusd_linux_amd64.tar.gz -a sha256 -b /tus/ -L -C -S | cut -c 6-999)'
1926
- 'wget $URL -O tusd_linux_amd64.tar.gz1'
2027
- '[[ "$(md5sum tusd_linux_amd64.tar.gz1)" == "$(md5sum tusd_linux_amd64.tar.gz)1" ]] || exit 1'

0 commit comments

Comments
 (0)