Skip to content

Commit 836c507

Browse files
committed
more configs
1 parent 2fd2df0 commit 836c507

10 files changed

+334
-85
lines changed

.github/workflows/codeql-analysis.yml

-74
This file was deleted.

.github/workflows/codeql.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: "22 8 * * 5"
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
language: ["go"]
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- uses: actions/setup-go@v5
30+
with:
31+
go-version: "stable"
32+
33+
- name: Initialize CodeQL
34+
uses: github/codeql-action/init@v3
35+
with:
36+
languages: ${{ matrix.language }}
37+
38+
- name: Autobuild
39+
uses: github/codeql-action/autobuild@v3
40+
41+
- name: Perform CodeQL Analysis
42+
uses: github/codeql-action/analyze@v3

.github/workflows/go.yml

+9-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on: [push, pull_request]
33
jobs:
44
build:
55
name: Build
6+
timeout-minutes: 30
67
runs-on: ubuntu-latest
78
steps:
89
- name: Check out code
@@ -13,12 +14,16 @@ jobs:
1314
with:
1415
go-version: "stable"
1516

17+
- name: Install Task
18+
uses: arduino/setup-task@v2
19+
with:
20+
repo-token: ${{ secrets.GITHUB_TOKEN }}
21+
1622
- name: Get dependencies
17-
run: |
18-
go get -v -t -d ./...
23+
run: task deps
1924

2025
- name: Build
21-
run: make build
26+
run: task build
2227

2328
- name: Test
24-
run: make test
29+
run: task test

.github/workflows/golangci-lint.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
name: golangci-lint
2-
on: [push, workflow_dispatch]
2+
on: [push, pull_request, workflow_dispatch]
3+
permissions:
4+
contents: read
5+
pull-requests: read
6+
checks: write
7+
38
jobs:
49
golangci:
510
name: lint
11+
timeout-minutes: 30
612
runs-on: ubuntu-latest
713
steps:
814
- uses: actions/checkout@v4
@@ -15,3 +21,4 @@ jobs:
1521
uses: golangci/golangci-lint-action@v7
1622
with:
1723
version: latest
24+
args: --timeout=5m

.github/workflows/update.yml

+10-5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
jobs:
99
update:
1010
runs-on: ubuntu-latest
11+
timeout-minutes: 30
1112
steps:
1213
- name: checkout
1314
uses: actions/checkout@v4
@@ -19,18 +20,22 @@ jobs:
1920
with:
2021
go-version: "stable"
2122

23+
- name: Install Task
24+
uses: arduino/setup-task@v2
25+
with:
26+
repo-token: ${{ secrets.GITHUB_TOKEN }}
27+
2228
- name: update
23-
run: |
24-
make update
29+
run: task update
2530

2631
- name: setup git config
2732
run: |
2833
git config user.name "Github"
2934
git config user.email "<>"
3035
3136
- name: commit changes
32-
# need to override the default shell so we can check
33-
# for error codes. Otherwise it will always fail if
37+
# need to override the default shell, so we can check
38+
# for error codes. Otherwise, it will always fail if
3439
# one command returns an error code other than 0
3540
shell: bash --noprofile --norc -o pipefail {0}
3641
run: |
@@ -39,7 +44,7 @@ jobs:
3944
if [ $exit_status -eq 0 ]; then
4045
echo "nothing has changed"
4146
else
42-
git add go.mod go.sum
47+
git add .
4348
git commit -m "auto update from github actions"
4449
git push origin main
4550
fi

.github/workflows/yamllint.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: yamllint
2+
on:
3+
push:
4+
paths:
5+
- "**.yml"
6+
- "**.yaml"
7+
pull_request:
8+
workflow_dispatch:
9+
jobs:
10+
yamllint:
11+
name: yamllint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: karancode/yamllint-github-action@master
16+
with:
17+
# fail on warnings and errors
18+
yamllint_strict: true
19+
yamllint_config_filepath: ".yamllint.yml"

0 commit comments

Comments
 (0)