Skip to content

Commit

Permalink
Merge pull request #5 from nullswan/refactor/consolidate-go-mod
Browse files Browse the repository at this point in the history
refactor(modules): Consolidate Go modules to a single root go.mod file
  • Loading branch information
LMaxence authored Aug 28, 2024
2 parents 945e858 + 55bd49f commit eaae886
Show file tree
Hide file tree
Showing 27 changed files with 63 additions and 286 deletions.
72 changes: 1 addition & 71 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,77 +4,7 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "./cmd/cli"
schedule:
interval: "weekly"
commit-message:
prefix: "deps"
open-pull-requests-limit: 1
- package-ecosystem: "gomod"
directory: "./cmd/schemas"
schedule:
interval: "weekly"
commit-message:
prefix: "deps"
open-pull-requests-limit: 1
- package-ecosystem: "gomod"
directory: "./packages/cli"
schedule:
interval: "weekly"
commit-message:
prefix: "deps"
open-pull-requests-limit: 1
- package-ecosystem: "gomod"
directory: "./packages/configuration"
schedule:
interval: "weekly"
commit-message:
prefix: "deps"
open-pull-requests-limit: 1
- package-ecosystem: "gomod"
directory: "./packages/executor"
schedule:
interval: "weekly"
commit-message:
prefix: "deps"
open-pull-requests-limit: 1
- package-ecosystem: "gomod"
directory: "./packages/git-client"
schedule:
interval: "weekly"
commit-message:
prefix: "deps"
open-pull-requests-limit: 1
- package-ecosystem: "gomod"
directory: "./packages/hooks-scripts"
schedule:
interval: "weekly"
commit-message:
prefix: "deps"
open-pull-requests-limit: 1
- package-ecosystem: "gomod"
directory: "./packages/logging"
schedule:
interval: "weekly"
commit-message:
prefix: "deps"
open-pull-requests-limit: 1
- package-ecosystem: "gomod"
directory: "./packages/meta"
schedule:
interval: "weekly"
commit-message:
prefix: "deps"
open-pull-requests-limit: 1
- package-ecosystem: "gomod"
directory: "./packages/scheduler"
schedule:
interval: "weekly"
commit-message:
prefix: "deps"
open-pull-requests-limit: 1
- package-ecosystem: "gomod"
directory: "./packages/test-helpers"
directory: "."
schedule:
interval: "weekly"
commit-message:
Expand Down
22 changes: 1 addition & 21 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,16 @@ env:
GOLANGCI_LINT_VERSION: v1.58

jobs:
detect-modules:
runs-on: ubuntu-latest
outputs:
modules: ${{ steps.set-modules.outputs.modules }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Golang
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: List Go modules
id: set-modules
run: echo "modules=$(go list -m -json | jq -s '.' | jq -c '[.[].Dir]')" >> $GITHUB_OUTPUT

golangci-lint:
needs: detect-modules
runs-on: ubuntu-latest
strategy:
matrix:
modules: ${{ fromJSON(needs.detect-modules.outputs.modules) }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Golang
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Run golangci-lint in ${{ matrix.modules }}
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
working-directory: ${{ matrix.modules }}
2 changes: 1 addition & 1 deletion .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Create temporary directory
run: mkdir -p ${{ github.workspace }}/tmp
- name: Run Golang tests
run: go test -coverprofile=coverage.txt $(go list -f '{{.Dir}}/...' -m)
run: go test -coverprofile=coverage.txt ./...
env:
TMPDIR: ${{ github.workspace }}/tmp
- name: Upload results to Codecov
Expand Down
3 changes: 0 additions & 3 deletions cmd/cli/go.mod

This file was deleted.

10 changes: 0 additions & 10 deletions cmd/schemas/go.mod

This file was deleted.

12 changes: 0 additions & 12 deletions cmd/schemas/go.sum

This file was deleted.

23 changes: 23 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module github.com/LMaxence/gookme

go 1.22.4

require (
github.com/alecthomas/jsonschema v0.0.0-20220216202328-9eeeec9d044b
github.com/bmatcuk/doublestar/v4 v4.6.1
github.com/google/uuid v1.6.0
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.9.0
github.com/urfave/cli/v2 v2.27.4
)

require (
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
35 changes: 35 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
github.com/alecthomas/jsonschema v0.0.0-20220216202328-9eeeec9d044b h1:doCpXjVwui6HUN+xgNsNS3SZ0/jUZ68Eb+mJRNOZfog=
github.com/alecthomas/jsonschema v0.0.0-20220216202328-9eeeec9d044b/go.mod h1:/n6+1/DWPltRLWL/VKyUxg6tzsl5kHUCcraimt4vr60=
github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I=
github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 h1:i462o439ZjprVSFSZLZxcsoAe592sZB1rci2Z8j4wdk=
github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/urfave/cli/v2 v2.27.4 h1:o1owoI+02Eb+K107p27wEX9Bb8eqIoZCfLXloLUSWJ8=
github.com/urfave/cli/v2 v2.27.4/go.mod h1:m4QzxcD2qpra4z7WhzEGn74WZLViBnMpb1ToCAKdGRQ=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
17 changes: 0 additions & 17 deletions go.work

This file was deleted.

4 changes: 0 additions & 4 deletions go.work.sum

This file was deleted.

4 changes: 2 additions & 2 deletions hooks/pre-commit.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
},
{
"name": "Code quality",
"command": "golangci-lint run $(go list -f '{{.Dir}}/...' -m)",
"command": "golangci-lint run ./...",
"onlyOn": "*.go"
},
{
"name": "Assets generation",
"command": "make assets"
}
]
}
}
11 changes: 0 additions & 11 deletions packages/cli/go.mod

This file was deleted.

8 changes: 0 additions & 8 deletions packages/cli/go.sum

This file was deleted.

15 changes: 0 additions & 15 deletions packages/configuration/go.mod

This file was deleted.

14 changes: 0 additions & 14 deletions packages/configuration/go.sum

This file was deleted.

3 changes: 0 additions & 3 deletions packages/executor/go.mod

This file was deleted.

Empty file removed packages/executor/go.sum
Empty file.
11 changes: 0 additions & 11 deletions packages/git-client/go.mod

This file was deleted.

10 changes: 0 additions & 10 deletions packages/git-client/go.sum

This file was deleted.

3 changes: 0 additions & 3 deletions packages/hooks-scripts/go.mod

This file was deleted.

10 changes: 0 additions & 10 deletions packages/logging/go.mod

This file was deleted.

15 changes: 0 additions & 15 deletions packages/logging/go.sum

This file was deleted.

4 changes: 0 additions & 4 deletions packages/meta/go.mod

This file was deleted.

14 changes: 0 additions & 14 deletions packages/scheduler/go.mod

This file was deleted.

11 changes: 0 additions & 11 deletions packages/scheduler/go.sum

This file was deleted.

Loading

0 comments on commit eaae886

Please sign in to comment.