Skip to content

Commit c3eaae1

Browse files
committed
Add Dependabot and CI integration.
1 parent d2b45d4 commit c3eaae1

File tree

4 files changed

+159
-0
lines changed

4 files changed

+159
-0
lines changed

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: /
5+
schedule:
6+
interval: daily
7+
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "daily"
12+
groups:
13+
artifacts:
14+
patterns:
15+
- "actions/*-artifact"

.github/workflows/lint.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: lint
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
paths:
7+
- '.github/workflows/lint.yml'
8+
- '.golangci.yml'
9+
- '**.go'
10+
- 'go.*'
11+
pull_request:
12+
branches: [ master ]
13+
paths:
14+
- '.github/workflows/lint.yml'
15+
- '.golangci.yml'
16+
- '**.go'
17+
- 'go.*'
18+
19+
permissions:
20+
contents: read
21+
22+
jobs:
23+
lint:
24+
name: golang
25+
runs-on: ubuntu-24.04
26+
continue-on-error: true
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: actions/setup-go@v5
30+
with:
31+
go-version: "1.21"
32+
33+
- name: Install dependencies
34+
run: |
35+
sudo apt-get -y update
36+
sudo apt-get -y install libheif-dev
37+
38+
- name: lint
39+
uses: golangci/golangci-lint-action@v6.1.0
40+
with:
41+
version: latest
42+
args: --timeout=2m0s
43+
skip-cache: true
44+
45+
dependencies:
46+
name: dependencies
47+
runs-on: ubuntu-latest
48+
continue-on-error: true
49+
steps:
50+
- uses: actions/checkout@v4
51+
- uses: actions/setup-go@v5
52+
with:
53+
go-version: "stable"
54+
55+
- name: Check minimum supported version of Go
56+
run: |
57+
go mod tidy -go=1.21 -compat=1.21
58+
59+
- name: Check go.mod / go.sum
60+
run: |
61+
git add go.*
62+
git diff --cached --exit-code go.*

.github/workflows/test.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
paths:
7+
- '.github/workflows/test.yml'
8+
- '**.go'
9+
- 'go.*'
10+
pull_request:
11+
branches: [ master ]
12+
paths:
13+
- '.github/workflows/test.yml'
14+
- '**.go'
15+
- 'go.*'
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
go:
22+
strategy:
23+
matrix:
24+
go-version:
25+
- "1.21"
26+
- "1.22"
27+
- "1.23"
28+
runs-on: ubuntu-24.04
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: actions/setup-go@v5
32+
with:
33+
go-version: ${{ matrix.go-version }}
34+
35+
- name: Install dependencies
36+
run: |
37+
sudo apt-get -y update
38+
sudo apt-get -y install libheif-dev
39+
40+
- name: Run tests
41+
run: |
42+
go test -v ./...

.golangci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
linters:
2+
enable:
3+
- gofmt
4+
- revive
5+
6+
linters-settings:
7+
revive:
8+
ignoreGeneratedHeader: true
9+
severity: warning
10+
rules:
11+
- name: blank-imports
12+
- name: context-as-argument
13+
- name: context-keys-type
14+
- name: dot-imports
15+
- name: error-return
16+
#- name: error-strings
17+
- name: error-naming
18+
- name: exported
19+
- name: if-return
20+
- name: increment-decrement
21+
#- name: var-naming
22+
- name: var-declaration
23+
- name: package-comments
24+
- name: range
25+
- name: receiver-naming
26+
- name: time-naming
27+
- name: unexported-return
28+
#- name: indent-error-flow
29+
- name: errorf
30+
- name: empty-block
31+
- name: superfluous-else
32+
#- name: unused-parameter
33+
- name: unreachable-code
34+
- name: redefines-builtin-id
35+
36+
issues:
37+
exclude-rules:
38+
- path: \.gen\.go
39+
linters:
40+
- gofmt

0 commit comments

Comments
 (0)