Skip to content

Commit

Permalink
Merge pull request #1 from strukturag/ci-integration
Browse files Browse the repository at this point in the history
Add Dependabot and CI integration.
  • Loading branch information
fancycode committed Aug 27, 2024
2 parents d2b45d4 + c3eaae1 commit b64b7b9
Show file tree
Hide file tree
Showing 4 changed files with 159 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"
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

0 comments on commit b64b7b9

Please sign in to comment.