Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dependabot and CI integration. #1

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
62 changes: 62 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
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-24.04
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.21"

- name: Install dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install libheif-dev

- 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-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Install dependencies
run: |
sudo apt-get -y update
sudo 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
Loading