Skip to content

Commit

Permalink
build: move go.mod to sub directories
Browse files Browse the repository at this point in the history
To separate spec requirements from tool requirements.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
  • Loading branch information
bergwolf committed Oct 8, 2024
1 parent af03b9a commit 26a9535
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 18 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,26 @@ jobs:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
include:
- go-path: tools/mdctl
- go-path: specs-go
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332

- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
go-version-file: go.mod
go-version-file: specs-go/go.mod
cache: false

- name: Golangci lint
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86
with:
version: v1.54
args: --verbose
working-directory: ${{ matrix.go-path }}
args: --config $GITHUB_WORKSPACE/.golangci.yml --verbose

- name: Markdown lint
uses: docker://avtodev/markdown-lint:v1@sha256:6aeedc2f49138ce7a1cd0adffc1b1c0321b841dc2102408967d9301c031949ee
Expand Down
16 changes: 0 additions & 16 deletions go.mod

This file was deleted.

7 changes: 7 additions & 0 deletions specs-go/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module github.com/CloudNativeAI/model-spec/specs-go

go 1.23.1

require github.com/opencontainers/image-spec v1.1.0

require github.com/opencontainers/go-digest v1.0.0 // indirect
4 changes: 4 additions & 0 deletions specs-go/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=
github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM=
22 changes: 22 additions & 0 deletions tools/mdctl/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module github.com/CloudNativeAI/model-spec/tools/mdctl

go 1.23.1

replace github.com/CloudNativeAI/model-spec/specs-go => ../../specs-go/

require (
github.com/CloudNativeAI/model-spec/specs-go v0.0.0-00010101000000-000000000000
github.com/klauspost/compress v1.17.10
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.1.0
github.com/spf13/cobra v1.8.1
golang.org/x/term v0.24.0
oras.land/oras-go/v2 v2.5.0
)

require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.25.0 // indirect
)
File renamed without changes.

0 comments on commit 26a9535

Please sign in to comment.