-
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.
Ci
- Loading branch information
Showing
7 changed files
with
134 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# These are supported funding model platforms | ||
github: skx | ||
custom: https://steve.fi/donate/ |
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,44 @@ | ||
#!/bin/bash | ||
|
||
# The basename of our binary | ||
BASE="bfcc" | ||
|
||
# | ||
# We build on multiple platforms/archs | ||
# | ||
BUILD_PLATFORMS="linux darwin freebsd" | ||
BUILD_ARCHS="amd64 386" | ||
|
||
# For each platform | ||
for OS in ${BUILD_PLATFORMS[@]}; do | ||
|
||
# For each arch | ||
for ARCH in ${BUILD_ARCHS[@]}; do | ||
|
||
# Setup a suffix for the binary | ||
SUFFIX="${OS}" | ||
|
||
# i386 is better than 386 | ||
if [ "$ARCH" = "386" ]; then | ||
SUFFIX="${SUFFIX}-i386" | ||
else | ||
SUFFIX="${SUFFIX}-${ARCH}" | ||
fi | ||
|
||
# Windows binaries should end in .EXE | ||
if [ "$OS" = "windows" ]; then | ||
SUFFIX="${SUFFIX}.exe" | ||
fi | ||
|
||
echo "Building for ${OS} [${ARCH}] -> ${BASE}-${SUFFIX}" | ||
|
||
# Run the build | ||
export GOARCH=${ARCH} | ||
export GOOS=${OS} | ||
export CGO_ENABLED=0 | ||
|
||
# Build the main-binary | ||
go build -ldflags "-X main.version=$(git describe --tags 2>/dev/null || echo 'master')" -o "${BASE}-${SUFFIX}" | ||
|
||
done | ||
done |
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,33 @@ | ||
#!/bin/bash | ||
|
||
# Install tools to test our code-quality. | ||
go get -u golang.org/x/lint/golint | ||
go get -u golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow | ||
go get -u honnef.co/go/tools/cmd/staticcheck | ||
|
||
# Run the static-check tool - we ignore errors in goserver/static.go | ||
t=$(mktemp) | ||
staticcheck -checks all ./... > $t | ||
if [ -s $t ]; then | ||
echo "Found errors via 'staticcheck'" | ||
cat $t | ||
rm $t | ||
exit 1 | ||
fi | ||
rm $t | ||
|
||
# At this point failures cause aborts | ||
set -e | ||
|
||
# Run the linter | ||
echo "Launching linter .." | ||
golint -set_exit_status ./... | ||
echo "Completed linter .." | ||
|
||
# Run the shadow-checker | ||
echo "Launching shadowed-variable check .." | ||
go vet -vettool=$(which shadow) ./... | ||
echo "Completed shadowed-variable check .." | ||
|
||
# Run golang tests | ||
go test ./... |
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 @@ | ||
on: pull_request | ||
name: Pull Request | ||
jobs: | ||
test: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Test | ||
uses: skx/github-action-tester@master |
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,13 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
name: Push Event | ||
jobs: | ||
test: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Test | ||
uses: skx/github-action-tester@master |
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,14 @@ | ||
on: release | ||
name: Handle Release | ||
jobs: | ||
upload: | ||
name: Upload release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Upload | ||
uses: skx/github-action-publish-binaries@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
args: bfcc*-* |
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