forked from jesseduffield/lazydocker
-
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.
use github actions instead of circle ci
- Loading branch information
1 parent
846cadd
commit 212b9d0
Showing
5 changed files
with
185 additions
and
11 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,31 @@ | ||
name: Continuous Delivery | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Unshallow repo | ||
run: git fetch --prune --unshallow | ||
- name: Setup Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.18.x | ||
- name: Run goreleaser | ||
uses: goreleaser/goreleaser-action@v1 | ||
env: | ||
GITHUB_TOKEN: ${{secrets.API_TOKEN}} | ||
homebrew: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Bump Homebrew formula | ||
uses: dawidd6/action-homebrew-bump-formula@v3 | ||
with: | ||
token: ${{secrets.API_TOKEN}} | ||
formula: lazydocker |
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,99 @@ | ||
name: Continuous Integration | ||
|
||
env: | ||
GO_VERSION: 1.18 | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
ci: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- windows-latest | ||
name: ci - ${{matrix.os}} | ||
runs-on: ${{matrix.os}} | ||
env: | ||
GOFLAGS: -mod=vendor | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Setup Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.18.x | ||
- name: Cache build | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/go-build | ||
key: ${{runner.os}}-go-${{hashFiles('**/go.sum')}}-test | ||
restore-keys: | | ||
${{runner.os}}-go- | ||
- name: Test code | ||
run: | | ||
bash ./test.sh | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
GOFLAGS: -mod=vendor | ||
GOARCH: amd64 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Setup Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.18.x | ||
- name: Cache build | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/go-build | ||
key: ${{runner.os}}-go-${{hashFiles('**/go.sum')}}-build | ||
restore-keys: | | ||
${{runner.os}}-go- | ||
- name: Build linux binary | ||
run: | | ||
GOOS=linux go build | ||
- name: Build windows binary | ||
run: | | ||
GOOS=windows go build | ||
- name: Build darwin binary | ||
run: | | ||
GOOS=darwin go build | ||
lint: | ||
runs-on: ubuntu-latest | ||
env: | ||
GOFLAGS: -mod=vendor | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Setup Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.18.x | ||
- name: Cache build | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/go-build | ||
key: ${{runner.os}}-go-${{hashFiles('**/go.sum')}}-test | ||
restore-keys: | | ||
${{runner.os}}-go- | ||
- name: Lint | ||
uses: golangci/golangci-lint-action@v3.1.0 | ||
with: | ||
version: latest | ||
- name: Format code | ||
run: | | ||
if [ $(find . ! -path "./vendor/*" -name "*.go" -exec gofmt -s -d {} \;|wc -l) -gt 0 ]; then | ||
find . ! -path "./vendor/*" -name "*.go" -exec gofmt -s -d {} \; | ||
exit 1 | ||
fi | ||
- name: errors | ||
run: golangci-lint run | ||
if: ${{ failure() }} |
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,29 @@ | ||
linters: | ||
disable: | ||
- structcheck # gives false positives | ||
enable: | ||
- gofumpt | ||
- thelper | ||
- goimports | ||
- tparallel | ||
- wastedassign | ||
- exportloopref | ||
- unparam | ||
- prealloc | ||
- unconvert | ||
- exhaustive | ||
- makezero | ||
- nakedret | ||
# - goconst # TODO: enable and fix issues | ||
fast: false | ||
|
||
linters-settings: | ||
exhaustive: | ||
default-signifies-exhaustive: true | ||
|
||
nakedret: | ||
# the gods will judge me but I just don't like naked returns at all | ||
max-func-lines: 0 | ||
|
||
run: | ||
go: 1.18 |
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,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
echo "" > coverage.txt | ||
|
||
export GOFLAGS=-mod=vendor | ||
|
||
use_go_test=false | ||
if command -v gotest; then | ||
use_go_test=true | ||
fi | ||
|
||
for d in $( find ./* -maxdepth 10 ! -path "./vendor*" ! -path "./.git*" ! -path "./scripts*" -type d); do | ||
if ls $d/*.go &> /dev/null; then | ||
args="-race -coverprofile=profile.out -covermode=atomic $d" | ||
if [ "$use_go_test" == true ]; then | ||
gotest $args | ||
else | ||
go test $args | ||
fi | ||
if [ -f profile.out ]; then | ||
cat profile.out >> coverage.txt | ||
rm profile.out | ||
fi | ||
fi | ||
done |
This file was deleted.
Oops, something went wrong.