forked from gomods/athens
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make it easier to run all the same commands that Travis does (gomods#362
) * Make it easier to run all the same commands that Travis does * Add target to install dev tools * Dirty a temp directory instead of the repo root * Explain our new make targets * Set a TMPDIR on travis * Fix comment
- Loading branch information
Showing
10 changed files
with
70 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Hurray! We are glad that you want to contribute to our project! 👍 | ||
|
||
## Verify your work | ||
Run `make verify` to run all the same validations that our CI process runs, such | ||
as checking that the standard go formatting is applied, linting, etc. | ||
|
||
## Unit Tests | ||
Run `make test-unit` to run the unit tests. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
# check_gofmt.sh | ||
# Fail if a .go file hasn't been formatted with gofmt | ||
set -euo pipefail | ||
|
||
GO_FILES=$(find . -iname '*.go' -type f | grep -v /vendor/) # All the .go files, excluding vendor/ | ||
test -z $(gofmt -s -l $GO_FILES | tee /dev/stderr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# check_golint.sh | ||
# Run the linter on everything except generated code | ||
set -euo pipefail | ||
|
||
golint -set_exit_status $(go list ./... | grep -v '/mocks') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
#!/bin/bash | ||
|
||
set -xeuo pipefail | ||
|
||
TAR_GZ="buffalo_0.12.3_linux_amd64.tar.gz" | ||
BUFFALO_URL="https://github.com/gobuffalo/buffalo/releases/download/v0.12.3/${TAR_GZ}" | ||
BUFFALO_TARGET_BIN="./bin/buffalo" | ||
|
||
curl -L -o ${TAR_GZ} ${BUFFALO_URL} | ||
tar -xvf ${TAR_GZ} | ||
mv buffalo-no-sqlite ${BUFFALO_TARGET_BIN} | ||
curl -L -o ${TMPDIR}${TAR_GZ} ${BUFFALO_URL} | ||
tar -xzf ${TMPDIR}${TAR_GZ} -C ${TMPDIR} | ||
mkdir -p $(dirname ${BUFFALO_TARGET_BIN}) | ||
mv ${TMPDIR}/buffalo-no-sqlite ${BUFFALO_TARGET_BIN} | ||
chmod +x ${BUFFALO_TARGET_BIN} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# install_dev_deps.sh | ||
# Ensure that the tools needed to build locally are present | ||
set -xeuo pipefail | ||
|
||
go get github.com/golang/lint/golint | ||
go get github.com/golang/dep/cmd/dep | ||
go get -u -v golang.org/x/vgo | ||
./scripts/get_buffalo.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# test_unit.sh | ||
# Run the unit tests with the race detector and code coverage enabled | ||
set -xeuo pipefail | ||
|
||
go test -race -coverprofile cover.out -covermode atomic ./... |