Skip to content

Commit 219c54e

Browse files
committed
- [+] add github CI/CD
1 parent 0b01f87 commit 219c54e

4 files changed

Lines changed: 76 additions & 0 deletions

File tree

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
3+
version: 2
4+
updates:
5+
- package-ecosystem: "gomod"
6+
directory: "/" # Location of package manifests
7+
schedule:
8+
interval: "daily"

.github/workflows/gotidy.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Tidy
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
paths:
8+
- '.github/workflows/gotidy.yml'
9+
- 'go.mod'
10+
- 'go.sum'
11+
12+
jobs:
13+
fix:
14+
runs-on: ubuntu-latest
15+
steps:
16+
-
17+
name: Checkout
18+
uses: actions/checkout@v2.3.1
19+
-
20+
name: Set up Go
21+
uses: actions/setup-go@v2
22+
with:
23+
go-version: 1.13
24+
-
25+
name: Tidy
26+
run: |
27+
rm -f go.sum
28+
go mod tidy
29+
-
30+
name: Set up Git
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
run: |
34+
git config user.name GitHub
35+
git config user.email noreply@github.com
36+
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
37+
-
38+
name: Commit and push changes
39+
run: |
40+
git add .
41+
if output=$(git status --porcelain) && [ ! -z "$output" ]; then
42+
git commit --author "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" --message "Fix go modules"
43+
git push
44+
fi

.github/workflows/linter.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
on: [push, pull_request]
2+
name: Linter
3+
jobs:
4+
Golint:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Fetch Repository
8+
uses: actions/checkout@v2
9+
- name: Run Golint
10+
uses: reviewdog/action-golangci-lint@v1
11+
with:
12+
golangci_lint_flags: "--tests=false"

.github/workflows/security.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
on: [push, pull_request]
2+
name: Security
3+
jobs:
4+
Gosec:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Fetch Repository
8+
uses: actions/checkout@v2
9+
- name: Run Gosec
10+
uses: securego/gosec@master
11+
with:
12+
args: ./...

0 commit comments

Comments
 (0)