Skip to content
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
12 changes: 0 additions & 12 deletions .copywrite.hcl

This file was deleted.

12 changes: 10 additions & 2 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
version: 2
updates:
- package-ecosystem: gomod
directory: "/"
- package-ecosystem: "github-actions"
directories:
- "/"
schedule:
interval: "monthly"
labels:
- "dependencies"
- package-ecosystem: "gomod"
directories:
- "/"
schedule:
interval: "monthly"
labels:
Expand Down
55 changes: 21 additions & 34 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,28 @@
name: Run CI Tests
on: [push]
on:
pull_request:
paths-ignore:
- 'README.md'
- 'LICENSE'
push:
branches:
- 'main'
jobs:
run-copywrite:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-copywrite@v1.1.2
- name: verify copyright
run: |
copywrite headers --plan
run-lint:
runs-on: [macos-latest]
steps:
- uses: actions/checkout@v3
- uses: hashicorp/setup-golang@v1
with:
version-file: go.mod
- name: GolangCI-Lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.52.2
skip-cache: true
run-tests:
strategy:
fail-fast: false
matrix:
os:
- macos-11
- macos-12
- ubuntu-22.04
runs-on: ${{matrix.os}}
timeout-minutes: 5
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- uses: hashicorp/setup-golang@v1
- uses: actions/checkout@v6
- uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3
- uses: actions/setup-go@v6
with:
version-file: go.mod
cache: true
go-version-file: go.mod
- name: Show System
run: |
uname -a
just sysinfo
- name: Run Go Test
run: |
make vet
make test
just init tidy lint tests

43 changes: 43 additions & 0 deletions .github/workflows/scripts/golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
version: "2"
linters:
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- copyloopvar
- dogsled
- dupword
- durationcheck
- errname
- errorlint
- exhaustive
- gochecknoinits
- gocritic
- makezero
- misspell
- musttag
- nilnil
- noctx
- perfsprint
- prealloc
- predeclared
- reassign
- revive
- rowserrcheck
- sqlclosecheck
- tagalign
- usetesting
- whitespace
settings:
exhaustive:
default-signifies-exhaustive: true
exclusions:
generated: lax
presets:
- comments
formatters:
enable:
- gofmt
exclusions:
generated: lax
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*~
~*

# OS files
**/.DS_Store

# Go workspace file
go.work
go.work.sum

# Local source and binary files
.src/
.bin/

12 changes: 0 additions & 12 deletions .golangci.yaml

This file was deleted.

45 changes: 45 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
set shell := ["bash", "-u", "-c"]

export scripts := ".github/workflows/scripts"
export GOBIN := `echo $PWD/.bin`

# show available commands
[private]
default:
@just --list

# tidy up Go modules
[group('build')]
tidy:
go mod tidy

# run tests across source tree
[group('testing')]
tests:
go test -v -race -count=1 ./...

# run specific unit test
[group('testing')]
[no-cd]
test unit:
go test -v -count=1 -race -run {{unit}} 2>/dev/null

# apply go vet command on source tree
[group('lint')]
vet:
go vet ./...

# apply golangci-lint linters on source tree
[group('lint')]
lint: vet
$GOBIN/golangci-lint run --config {{scripts}}/golangci.yaml

# show host system information
[group('build')]
@sysinfo:
echo "{{os()/arch()}} {{num_cpus()}}c"

# locally install build dependencies
[group('build')]
init:
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.11.4
12 changes: 0 additions & 12 deletions Makefile

This file was deleted.

6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module github.com/shoenig/go-m1cpu

go 1.20
go 1.26

require github.com/shoenig/test v1.7.0
require github.com/shoenig/test v1.13.2

require github.com/google/go-cmp v0.6.0 // indirect
require github.com/google/go-cmp v0.7.0 // indirect
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/shoenig/test v1.7.0 h1:eWcHtTXa6QLnBvm0jgEabMRN/uJ4DMV3M8xUGgRkZmk=
github.com/shoenig/test v1.7.0/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/shoenig/test v1.13.2 h1:SaGxHxg7xkRuKuNtuFmHf0LgNGaAgcBT7HN4WHCKfqU=
github.com/shoenig/test v1.13.2/go.mod h1:MKmiRyEeuFl8y9PCoThaRDgYQZeWBhRQlH99poXz5LI=