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
30 changes: 30 additions & 0 deletions .github/workflows/callable-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,36 @@ jobs:
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: ${{ matrix.go-version-alias }}
cache: false

- name: Compute build cache key
id: build-cache-key
run: |
checksum=$(
{
cat go.mod
[ -f go.sum ] && cat go.sum
cat Makefile
find . -type f -name '*.go' \
-not -path './tools/*' \
-print0 | sort -z | xargs -0 cat
} | md5sum | awk '{print $1}'
)
echo "checksum=$checksum" >> "$GITHUB_OUTPUT"

- name: Cache Go module cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/go/pkg/mod
key: build-go-mod-${{ runner.os }}-${{ hashFiles('go.sum') }}

- name: Cache Go build cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cache/go-build
key: build-go-build-${{ runner.os }}-${{ matrix.go-version-alias }}-${{ steps.build-cache-key.outputs.checksum }}
restore-keys: |
build-go-build-${{ runner.os }}-${{ matrix.go-version-alias }}-

- name: Build
run: make build
30 changes: 30 additions & 0 deletions .github/workflows/callable-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,36 @@ jobs:
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: ${{ matrix.go-version-alias }}
cache: false

- name: Compute build cache key
id: build-cache-key
run: |
checksum=$(
{
cat go.mod
[ -f go.sum ] && cat go.sum
cat Makefile
find . -type f -name '*.go' \
-not -path './tools/*' \
-print0 | sort -z | xargs -0 cat
} | md5sum | awk '{print $1}'
)
echo "checksum=$checksum" >> "$GITHUB_OUTPUT"

- name: Cache Go module cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/go/pkg/mod
key: unit-test-go-mod-${{ runner.os }}-${{ hashFiles('go.sum') }}

- name: Cache Go build cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cache/go-build
key: unit-test-go-build-${{ runner.os }}-${{ matrix.go-version-alias }}-${{ steps.build-cache-key.outputs.checksum }}
restore-keys: |
unit-test-go-build-${{ runner.os }}-${{ matrix.go-version-alias }}-

- name: Run unit tests with coverage
run: make unittest-json
Expand Down
29 changes: 28 additions & 1 deletion .github/workflows/code-scanning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,34 @@ jobs:
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: tools/go.mod
cache-dependency-path: tools/go.sum
cache: false

- name: Compute build cache key
id: build-cache-key
run: |
checksum=$(
{
cat tools/go.mod tools/go.sum Makefile
find . -type f -name '*.go' \
-not -path './tools/*' \
-print0 | sort -z | xargs -0 cat
} | md5sum | awk '{print $1}'
)
echo "checksum=$checksum" >> "$GITHUB_OUTPUT"

- name: Cache Go module cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/go/pkg/mod
key: govulncheck-go-mod-${{ runner.os }}-${{ hashFiles('tools/go.sum') }}

- name: Cache Go build cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cache/go-build
key: govulncheck-go-build-${{ runner.os }}-${{ steps.build-cache-key.outputs.checksum }}
restore-keys: |
govulncheck-go-build-${{ runner.os }}-

- name: Run vulnerability scan
run: make vulncheck-sarif
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,23 @@ jobs:
go-version: "stable"
cache: false

- name: Cache Go modules and build cache
- name: Compute build cache key
id: build-cache-key
run: echo "checksum=${{ hashFiles('go.mod', 'go.sum', 'tools/go.mod', 'tools/go.sum', '**/*.go') }}" >> "$GITHUB_OUTPUT"

- name: Cache Go module cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/go/pkg/mod
key: copilot-go-mod-${{ runner.os }}-${{ hashFiles('go.sum', 'tools/go.sum') }}

- name: Cache Go build cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: copilot-go-${{ hashFiles('go.sum', 'tools/go.sum') }}
restore-keys: copilot-go-
path: ~/.cache/go-build
key: copilot-go-build-${{ runner.os }}-${{ steps.build-cache-key.outputs.checksum }}
restore-keys: |
copilot-go-build-${{ runner.os }}-

- name: Download Go module dependencies
run: |
Expand Down