Skip to content
Open
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
34 changes: 34 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2026 Defense Unicorns
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

name: Setup
description: Install repository tools with mise and restore Go caches

runs:
using: composite
steps:
- name: Setup mise
uses: jdx/mise-action@9e7f7633ff6f6d6048a9418a68d48f288f50eb14 # v4.2.3
with:
# renovate: datasource=github-releases depName=jdx/mise versioning=semver
version: 2026.8.1
install: true
cache: true

- name: Get Go cache configuration
id: go-cache
shell: bash
run: |
echo "build=$(go env GOCACHE)" >> "$GITHUB_OUTPUT"
echo "modules=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
echo "version=$(go env GOVERSION)" >> "$GITHUB_OUTPUT"

- name: Cache Go modules and build artifacts
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we restore the cache in the shared action, but save it only from the unit job after tests finish? Right now all jobs try to save the same cache, so some waste time and fail with cache reservation warnings.

with:
path: |
${{ steps.go-cache.outputs.modules }}
${{ steps.go-cache.outputs.build }}
key: ${{ runner.os }}-${{ runner.arch }}-go-${{ steps.go-cache.outputs.version }}-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-go-${{ steps.go-cache.outputs.version }}-
9 changes: 2 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,8 @@ jobs:
fetch-tags: true
persist-credentials: false

- name: Setup mise
uses: jdx/mise-action@9e7f7633ff6f6d6048a9418a68d48f288f50eb14 # v4.2.3
with:
# renovate: datasource=github-releases depName=jdx/mise versioning=semver
version: 2026.8.1
install: true
cache: true
- name: Setup tools
uses: ./.github/actions/setup

- name: Install syft
uses: anchore/sbom-action/download-syft@e22c389904149dbc22b58101806040fa8d37a610 # v0.24.0
Expand Down
21 changes: 3 additions & 18 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: jdx/mise-action@9e7f7633ff6f6d6048a9418a68d48f288f50eb14 # v4.2.3
with:
# renovate: datasource=github-releases depName=jdx/mise versioning=semver
version: 2026.8.1
install: true
cache: true
- uses: ./.github/actions/setup
- name: Lint
run: uds run lint:check

Expand All @@ -53,12 +48,7 @@ jobs:
with:
persist-credentials: false

- uses: jdx/mise-action@9e7f7633ff6f6d6048a9418a68d48f288f50eb14 # v4.2.3
with:
# renovate: datasource=github-releases depName=jdx/mise versioning=semver
version: 2026.8.1
install: true
cache: true
- uses: ./.github/actions/setup

- name: Acceptance tests
run: uds run test-acc
Expand All @@ -78,12 +68,7 @@ jobs:
with:
persist-credentials: false

- uses: jdx/mise-action@9e7f7633ff6f6d6048a9418a68d48f288f50eb14 # v4.2.3
with:
# renovate: datasource=github-releases depName=jdx/mise versioning=semver
version: 2026.8.1
install: true
cache: true
- uses: ./.github/actions/setup

- name: Unit tests
run: uds run test-unit
Loading