Skip to content

Bump actions/cache from 4.2.3 to 4.3.0 #83

Bump actions/cache from 4.2.3 to 4.3.0

Bump actions/cache from 4.2.3 to 4.3.0 #83

Workflow file for this run

# Copyright 2021 Chainguard, Inc.
# SPDX-License-Identifier: Apache-2.0
name: Test
on:
pull_request:
branches: [ 'main', 'release-*' ]
permissions: {}
jobs:
test:
permissions:
contents: read # for actions/checkout to fetch code
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
with:
egress-policy: audit
- name: Check out code onto GOPATH
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
# In order:
# * Module download cache
# * Build cache (Linux)
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version-file: './go.mod'
- run: |
# We limit the depth to 3 mostly to avoid go.mod files that get pulled into `third_party` like some hashicorp repos.
for dir in $(find . -name go.mod -maxdepth 3 -exec dirname {} \; ); do
echo "::group:: $dir"
pushd $dir
# Exclude running unit tests against third_party repos.
go test -race $(go list ./... | grep -v third_party/)
popd
echo ::endgroup::
done