Skip to content

Commit

Permalink
Add Dependabot and CI integration.
Browse files Browse the repository at this point in the history
  • Loading branch information
fancycode committed Aug 26, 2024
1 parent d2b45d4 commit 4496102
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: gomod
directory: /
schedule:
interval: daily

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
groups:
artifacts:
patterns:
- "actions/*-artifact"
57 changes: 57 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: lint

on:
push:
branches: [ master ]
paths:
- '.github/workflows/lint.yml'
- '.golangci.yml'
- '**.go'
- 'go.*'
pull_request:
branches: [ master ]
paths:
- '.github/workflows/lint.yml'
- '.golangci.yml'
- '**.go'
- 'go.*'

permissions:
contents: read

jobs:
lint:
name: golang
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.21"

- name: lint
uses: golangci/[email protected]
with:
version: latest
args: --timeout=2m0s
skip-cache: true

dependencies:
name: dependencies
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "stable"

- name: Check minimum supported version of Go
run: |
go mod tidy -go=1.21 -compat=1.21
- name: Check go.mod / go.sum
run: |
git add go.*
git diff --cached --exit-code go.*
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: test

on:
push:
branches: [ master ]
paths:
- '.github/workflows/test.yml'
- '**.go'
- 'go.*'
pull_request:
branches: [ master ]
paths:
- '.github/workflows/test.yml'
- '**.go'
- 'go.*'

permissions:
contents: read

jobs:
go:
strategy:
matrix:
go-version:
- "1.21"
- "1.22"
- "1.23"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Install dependencies
run: |
apt-get -y update
apt-get -y install libheif-dev
- name: Run tests
run: |
go test -v ./...
40 changes: 40 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
linters:
enable:
- gofmt
- revive

linters-settings:
revive:
ignoreGeneratedHeader: true
severity: warning
rules:
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: error-return
#- name: error-strings
- name: error-naming
- name: exported
- name: if-return
- name: increment-decrement
#- name: var-naming
- name: var-declaration
- name: package-comments
- name: range
- name: receiver-naming
- name: time-naming
- name: unexported-return
#- name: indent-error-flow
- name: errorf
- name: empty-block
- name: superfluous-else
#- name: unused-parameter
- name: unreachable-code
- name: redefines-builtin-id

issues:
exclude-rules:
- path: \.gen\.go
linters:
- gofmt

0 comments on commit 4496102

Please sign in to comment.