Compare commits
2 Commits
857ddb66b0
...
a557f452a7
Author | SHA1 | Date |
---|---|---|
Oskar | a557f452a7 | |
Oskar | b6fc96d90a |
|
@ -1,18 +1,21 @@
|
||||||
name: auto fix
|
name: CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- "**"
|
- main
|
||||||
|
|
||||||
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
auto-fix:
|
ci:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Repo clone (go mod tidy / gofmt)
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
|
@ -21,27 +24,46 @@ jobs:
|
||||||
go-version: 1.17
|
go-version: 1.17
|
||||||
|
|
||||||
- name: Setup Git
|
- name: Setup Git
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
run: |
|
run: |
|
||||||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
git config --local user.name "github-actions[bot]"
|
git config --local user.name "github-actions[bot]"
|
||||||
|
|
||||||
- name: tidy
|
- name: Tidy
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
run: |
|
run: |
|
||||||
go mod tidy
|
go mod tidy
|
||||||
git add .
|
git add .
|
||||||
git diff-index --quiet HEAD || git commit -m "go mod tidy"
|
git diff-index --quiet HEAD || git commit -m "go mod tidy"
|
||||||
|
|
||||||
- name: gofmt
|
- name: GoFmt
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
run: |
|
run: |
|
||||||
go fmt ./...
|
go fmt ./...
|
||||||
git add .
|
git add .
|
||||||
git diff-index --quiet HEAD || git commit -m "gofmt"
|
git diff-index --quiet HEAD || git commit -m "gofmt"
|
||||||
|
|
||||||
- name: Pull changes
|
- name: Pull changes
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
run: git pull -r
|
run: git pull -r
|
||||||
|
|
||||||
- name: Push changes
|
- name: Push changes
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
uses: ad-m/github-push-action@master
|
uses: ad-m/github-push-action@master
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
branch: ${{ github.ref }}
|
branch: ${{ github.ref }}
|
||||||
|
|
||||||
|
- name: Repo clone (test)
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: go test -v ./...
|
||||||
|
|
||||||
|
- name: Semantic Release
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: go-semantic-release/action@v1
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
@ -1,19 +0,0 @@
|
||||||
name: test
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v2
|
|
||||||
with:
|
|
||||||
go-version: 1.16
|
|
||||||
|
|
||||||
- name: Test
|
|
||||||
run: go test -v ./...
|
|
|
@ -25,3 +25,7 @@ var Log = &logrus.Logger{
|
||||||
Hooks: make(logrus.LevelHooks),
|
Hooks: make(logrus.LevelHooks),
|
||||||
Level: logrus.InfoLevel,
|
Level: logrus.InfoLevel,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
Log.SetReportCaller(true)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue