Skip to content

Commit 34672f2

Browse files
committed
Move commands to separate modules
Make each helper command its own module to avoid maintaining every tool's dependencies in a single go.mod. Also remove update-deps.sh and update-codegen.sh which weren't used anywhere. Signed-off-by: Colleen Murphy <[email protected]>
1 parent cb48a63 commit 34672f2

File tree

87 files changed

+5380
-539
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+5380
-539
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ updates:
2626
- "cloud-sql-proxy"
2727

2828
- package-ecosystem: gomod
29-
directory: "/"
29+
directories:
30+
- "/"
31+
- "/tools/*"
32+
- "/hack/"
3033
schedule:
3134
interval: weekly
3235
open-pull-requests-limit: 10

.github/workflows/add-remove-new-fulcio.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
GO111MODULE: on
4141
GOFLAGS: -ldflags=-s -ldflags=-w
4242
KO_DOCKER_REPO: registry.local:5000/knative
43-
KOCACHE: ~/ko
43+
KOCACHE: /home/runner/ko
4444

4545
steps:
4646
- uses: chainguard-dev/actions/setup-mirror@3e8a2a226fad9e1ecbf2d359b8a7697554a4ac6d # v1.5.10
@@ -203,7 +203,7 @@ jobs:
203203

204204
- name: Verify both Fulcio certs are there
205205
run: |
206-
go run ./cmd/ctlog/verifyfulcio/main.go \
206+
go run ./tools/ctlog/cmd/ctlog/verifyfulcio/main.go \
207207
--ctlog-url ${CTLOG_URL} \
208208
--log-prefix sigstorescaffolding \
209209
--fulcio ${FULCIO_URL} \
@@ -232,7 +232,7 @@ jobs:
232232

233233
- name: Verify that only new Fulcio cert is there
234234
run: |
235-
go run ./cmd/ctlog/verifyfulcio/main.go \
235+
go run ./tools/ctlog/cmd/ctlog/verifyfulcio/main.go \
236236
--ctlog-url ${CTLOG_URL} \
237237
--log-prefix sigstorescaffolding \
238238
--fulcio ${NEW_FULCIO_URL}

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ jobs:
3939
filters: |
4040
gocode:
4141
- 'pkg/**'
42-
- 'cmd/**'
42+
- 'tools/**'
4343
4444
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
4545
with:
46-
go-version-file: 'go.mod'
46+
go-version-file: 'go.work'
4747

4848
# Initializes the CodeQL tools for scanning.
4949
- name: Initialize CodeQL

.github/workflows/create-tink-keyset-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
- main
77
paths:
8-
- 'cmd/create-tink-keyset/**'
8+
- 'tools/create-tink-keyset/cmd/create-tink-keyset/**'
99

1010
permissions:
1111
contents: read
@@ -23,9 +23,9 @@ jobs:
2323
- name: Set up Go
2424
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
2525
with:
26-
go-version-file: 'go.mod'
26+
go-version-file: 'go.work'
2727
check-latest: true
2828

2929
- name: Create Tink Keyset build
3030
id: create-tink-keyset-test
31-
run: go build ./cmd/create-tink-keyset
31+
run: go build ./tools/create-tink-keyset/cmd/create-tink-keyset

.github/workflows/fulcio-rekor-kind.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
GO111MODULE: on
4141
GOFLAGS: -ldflags=-s -ldflags=-w
4242
KO_DOCKER_REPO: registry.local:5000/knative
43-
KOCACHE: ~/ko
43+
KOCACHE: /home/runner/ko
4444

4545
steps:
4646
- name: Check out our repo

.github/workflows/prober-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ on:
66
branches:
77
- main
88
paths:
9-
- 'cmd/prober/**'
9+
- 'tools/prober/cmd/prober/**'
1010
pull_request:
1111
branches:
1212
- main
1313
paths:
14-
- 'cmd/prober/**'
14+
- 'tools/prober/cmd/prober/**'
1515

1616
permissions:
1717
contents: read
@@ -40,11 +40,11 @@ jobs:
4040
- name: Set up Go
4141
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
4242
with:
43-
go-version-file: 'go.mod'
43+
go-version-file: 'go.work'
4444
check-latest: true
4545

4646
- name: Build prober test
47-
run: go build ./cmd/prober
47+
run: go build ./tools/prober/cmd/prober
4848

4949
- name: Get test OIDC token
5050
uses: sigstore-conformance/extremely-dangerous-public-oidc-beacon@main

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
3232
with:
33-
go-version-file: ./src/github.com/${{ github.repository }}/go.mod
33+
go-version-file: ./src/github.com/${{ github.repository }}/go.work
3434
check-latest: true
3535

3636
- name: Install ko

.github/workflows/test-action-tuf.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ jobs:
3737
steps:
3838
- name: Checkout the current action
3939
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
40+
path: ./src/github.com/sigstore/scaffolding
4041
with:
4142
persist-credentials: false
4243
- name: Test running the action
43-
uses: ./actions/setup
44+
uses: ./src/github.com/sigstore/scaffolding/actions/setup
4445
with:
4546
k8s-version: ${{ matrix.k8s-version }}
4647
version: ${{ matrix.release-version }}
48+
working-directory: ./src/github.com/sigstore/scaffolding
4749

4850
# Install cosign
4951
- name: Install cosign

.github/workflows/test-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
env:
3434
RELEASE_VERSION: "v0.7.22"
3535
KO_DOCKER_REPO: registry.local:5000/knative
36-
KOCACHE: ~/ko
36+
KOCACHE: /home/runner/ko
3737

3838
steps:
3939
- uses: chainguard-dev/actions/setup-mirror@3e8a2a226fad9e1ecbf2d359b8a7697554a4ac6d # v1.5.10

.github/workflows/verify.yml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
2121
with:
22-
go-version-file: 'go.mod'
22+
go-version-file: 'go.work'
2323
check-latest: true
2424
cache: true
2525

@@ -42,37 +42,62 @@ jobs:
4242
- name: Run ShellCheck
4343
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # v2.0.0
4444

45+
detect-modules:
46+
runs-on: ubuntu-latest
47+
outputs:
48+
modules: ${{ steps.set-modules.outputs.modules }}
49+
steps:
50+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
51+
with:
52+
persist-credentials: false
53+
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
54+
with:
55+
go-version-file: 'go.work'
56+
check-latest: true
57+
- id: set-modules
58+
run: echo "modules=$(go list -m -json | jq -s 'del(.[] | select(.Path == "github.com/sigstore/scaffolding/hack"))' | jq -c '[.[].Dir]')" >> $GITHUB_OUTPUT
59+
4560
golangci:
4661
name: lint
62+
needs: detect-modules
4763
runs-on: ubuntu-latest
64+
strategy:
65+
matrix:
66+
modules: ${{ fromJSON(needs.detect-modules.outputs.modules) }}
4867
steps:
4968
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5069
with:
5170
persist-credentials: false
5271

5372
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
5473
with:
55-
go-version-file: 'go.mod'
74+
go-version-file: 'go.work'
5675
check-latest: true
5776

5877
- name: golangci-lint
5978
uses: golangci/golangci-lint-action@e7fa5ac41e1cf5b7d48e45e42232ce7ada589601 # v9.1.0
6079
with:
6180
version: v2.4
81+
working-directory: ${{ matrix.modules }}
6282

6383
unit-test:
6484
name: run unit tests
85+
needs: detect-modules
6586
runs-on: ubuntu-latest
87+
strategy:
88+
matrix:
89+
modules: ${{ fromJSON(needs.detect-modules.outputs.modules) }}
6690
steps:
6791
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
6892
with:
6993
persist-credentials: false
7094

7195
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
7296
with:
73-
go-version-file: 'go.mod'
97+
go-version-file: 'go.work'
7498
check-latest: true
7599

76100
- name: run unit tests
77101
run: |
78-
go test $(go list ./... | grep -v third_party/)
102+
cd ${{ matrix.modules }}
103+
go test ./...

0 commit comments

Comments
 (0)