Skip to content
Open
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
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Go
on:
push:
branches: [ main ]
tags:
- v*
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: 'stable'
check-latest: true

- name: Test
run: go test -v ./...

- name: Build
run: go build -v .

- name: Run goreleaser in release mode
if: success() && startsWith(github.ref, 'refs/tags/v')
uses: goreleaser/goreleaser-action@v7
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- main
pull_request:

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.12.2
28 changes: 0 additions & 28 deletions .github/workflows/unittest.yml

This file was deleted.

68 changes: 8 additions & 60 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,63 +1,11 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

# C extensions
*.so
.idea
\#*
.\#*
TODO*

# Distribution / packaging
.Python
env/
venv/
.venv/
build/
develop-eggs/
check_hwgroup
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Editors
\#*
.\#*
vendor/
coverage.html
coverage.out
60 changes: 60 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
version: "2"
run:
tests: false
linters:
default: all
enable:
- wsl_v5
- gomodguard_v2
disable:
- wsl
- gomodguard
- cyclop
- depguard
- err113
- exhaustruct
- forbidigo
- forcetypeassert
- gochecknoglobals
- gochecknoinits
- godot
- godox
- lll
- mnd
- musttag
- nakedret
- nlreturn
- nolintlint
- nonamedreturns
- tagliatelle
- varnamelen
- wrapcheck
- funlen
settings:
wsl_v5:
allow-first-in-block: true
allow-whole-block: true
branch-max-lines: 2
disable:
- err
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
45 changes: 45 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# See documentation at https://goreleaser.com
version: 2
before:
hooks:
- go mod download
builds:
- env:
- CGO_ENABLED=0
goarch:
- amd64
- arm64
goos:
- linux
- windows
- darwin
ldflags:
- >-
-s -w -X main.version={{.Version}}
-X main.commit={{.Commit}}
-X main.date={{.CommitDate}}
release:
draft: true
github:
owner: NETWAYS
name: check_hwgroup
archives:
- formats:
- binary
name_template: >-
{{ .ProjectName }}_{{ .Tag }}_
{{- if eq .Os "linux" }}Linux{{ end }}
{{- if eq .Os "windows" }}Windows{{ end }}
{{- if eq .Os "darwin" }}Darwin{{ end }}
{{- if eq .Arch "amd64" }}_x86_64{{ end }}
{{- if eq .Arch "arm64" }}_arm64{{ end }}
checksum:
name_template: 'checksums.txt'
snapshot:
version_template: '{{ .Tag }}-SNAPSHOT-{{.ShortCommit}}'
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
Loading