Test Go caching #1922
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Go caching | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- "*" | |
schedule: | |
- cron: "10 */6 * * *" | |
workflow_dispatch: | |
# Allow check to run on the merge queue so that it is eligible to be a "required" check. | |
merge_group: | |
types: [checks_requested] | |
permissions: | |
contents: read | |
jobs: | |
go: | |
strategy: | |
matrix: | |
go-version: [1.23.x] | |
profile: [namespace-profile-e2e-medium] | |
runs-on: | |
- ${{ matrix.profile }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
cache: false | |
- name: Check existing directories | |
run: | | |
ls -al /home/runner/go | |
- name: Setup Go cache | |
uses: ./ # Uses an action in the root directory | |
with: | |
cache: go | |
- name: Run a Go build | |
run: | | |
go install namespacelabs.dev/foundation/cmd/ns@latest | |
- name: Print cache metadata file | |
run: cat /cache/.ns/cache-metadata.json | |
- name: Breakpoint on failure | |
if: failure() && github.ref_name == 'main' | |
uses: namespacelabs/breakpoint-action@v0 | |
with: | |
duration: 15m | |
authorized-users: edganiukov,hugosantos,n-g,htr,nichtverstehen,gmichelo | |
gonocache: | |
strategy: | |
matrix: | |
go-version: [1.23.x] | |
profile: [namespace-profile-default] | |
runs-on: | |
- ${{ matrix.profile }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Check existing directories | |
run: | | |
ls -al /home/runner/go | |
- name: Run a Go build | |
run: | | |
go install namespacelabs.dev/foundation/cmd/ns@latest | |
- name: Breakpoint on failure | |
if: failure() && github.ref_name == 'main' | |
uses: namespacelabs/breakpoint-action@v0 | |
with: | |
duration: 15m | |
authorized-users: edganiukov,hugosantos,n-g,htr,nichtverstehen,gmichelo |