-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from mlcdf/wip
Merge wip into main
- Loading branch information
Showing
29 changed files
with
1,095 additions
and
450 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,52 @@ | ||
name: test | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.19" | ||
check-latest: true | ||
cache: true | ||
|
||
- name: Test | ||
run: go test -v -race ./... | ||
|
||
- name: Generate coverage report in HTML | ||
run: go tool cover -html dist/coverage.out -o report.html | ||
|
||
- name: GitHub Badge | ||
run: | | ||
total=$(go tool cover -func dist/coverage.out | grep total| grep -Eo '[0-9]+\.[0-9]+') | ||
if (( $(echo "$total <= 50" | bc -l) )) ; then | ||
COLOR=red | ||
elif (( $(echo "$total > 80" | bc -l) )); then | ||
COLOR=brightgreen | ||
else | ||
COLOR=orange | ||
fi | ||
mkdir -p dist | ||
cp report.html dist/report.html | ||
curl "https://img.shields.io/badge/coverage-$total%25-$COLOR" > dist/badge.svg | ||
cd dist | ||
git init | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git add . | ||
git commit -m "Updated coverage" | ||
- name: Push changes | ||
uses: mlcdf/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
branch: coverage | ||
force: true | ||
directory: dist |
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,23 +1,21 @@ | ||
name: test | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ">=1.18.0-rc.1" | ||
go-version: "1.19" | ||
check-latest: true | ||
cache: true | ||
|
||
- name: Test | ||
run: go test -v -race ./... | ||
env: | ||
GANDI_TOKEN: ${{ secrets.GANDI_TOKEN }} |
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 |
---|---|---|
|
@@ -10,4 +10,6 @@ | |
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
*.out | ||
|
||
dist/ |
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,14 @@ | ||
//go:build testbincover | ||
// +build testbincover | ||
|
||
package main | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/confluentinc/bincover" | ||
) | ||
|
||
func TestBincoverRunMain(t *testing.T) { | ||
bincover.RunTest(func() { bincover.ExitCode = int(mainRun()) }) | ||
} |
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,16 @@ | ||
version: "3" | ||
services: | ||
smocker: | ||
image: thiht/smocker | ||
ports: | ||
- 8080:8080 | ||
- 8081:8081 | ||
|
||
db: | ||
image: postgres | ||
environment: | ||
POSTGRES_DB: database | ||
POSTGRES_USER: user | ||
POSTGRES_PASSWORD: password | ||
ports: | ||
- 8082:5432 |
Oops, something went wrong.