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
14 changes: 14 additions & 0 deletions .agents/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -euo pipefail

curl -fsSL https://mise.run/bash | sh

"$HOME/.local/bin/mise" trust
"$HOME/.local/bin/mise" install --locked \
actionlint \
go \
"go:golang.org/x/vuln/cmd/govulncheck" \
gofumpt \
golangci-lint \
yamlfmt
72 changes: 45 additions & 27 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ jobs:
- "tests/**"
- "**/*.go"
- "go.*"
- "mise.toml"
- "mise.lock"
- ".golangci.yml"
- "main.go"
- ".github/actions/**"
- ".github/workflows/main.yml"
deps:
- "go.mod"
- "go.sum"
- "mise.toml"
- "mise.lock"
- ".github/workflows/main.yml"
workflows:
- ".github/workflows/**.yml"
Expand All @@ -48,7 +52,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
- uses: dhth/composite-actions/.github/actions/lint-go@main
- name: Set up mise
uses: jdx/mise-action@v4
with:
install_args: go golangci-lint
- name: Lint
run: mise run lint

build:
needs: changes
Expand All @@ -59,25 +68,25 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6.0.2
- name: Set up Go
uses: actions/setup-go@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
go-version-file: 'go.mod'
- name: go build
run: go build -v ./...
install_args: go
- name: Build
run: mise run build

test:
needs: changes
if: ${{ needs.changes.outputs.code == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
- name: Set up Go
uses: actions/setup-go@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
go-version-file: 'go.mod'
- name: go test
run: go test -v ./...
install_args: go
- name: Test
run: mise run test

lint-yaml:
needs: changes
Expand All @@ -86,7 +95,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- uses: dhth/composite-actions/.github/actions/lint-yaml@main
- name: Set up mise
uses: jdx/mise-action@v4
with:
install_args: yamlfmt
- name: Lint YAML
run: mise run lint:yaml

lint-workflows:
needs: changes
Expand All @@ -95,11 +109,17 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- uses: dhth/composite-actions/.github/actions/lint-actions@main
- name: Set up mise
uses: jdx/mise-action@v4
with:
install_args: actionlint
- name: Lint workflows
run: mise run lint:actions

back-compat:
needs: changes
if: ${{ needs.changes.outputs.code == 'true' }}
# Re-enable after mise is available in both compared revisions.
if: ${{ false && needs.changes.outputs.code == 'true' }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
Expand All @@ -111,20 +131,20 @@ jobs:
with:
fetch-depth: 2
- run: git checkout HEAD~1
- name: Set up Go for head~1
uses: actions/setup-go@v6
- name: Set up mise for head~1
uses: jdx/mise-action@v4
with:
go-version-file: 'go.mod'
install_args: go
- name: build last commit
run: |
go build -o omm_prev
cp omm_prev /var/tmp
rm omm_prev
- run: git checkout main
- name: Set up Go for head
uses: actions/setup-go@v6
- name: Set up mise for head
uses: jdx/mise-action@v4
with:
go-version-file: 'go.mod'
install_args: go
- name: build head
run: |
go build -o omm_head
Expand All @@ -145,11 +165,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
- name: Set up Go
uses: actions/setup-go@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
go-version-file: 'go.mod'
- name: install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: govulncheck
run: govulncheck ./...
install_args: go go:golang.org/x/vuln/cmd/govulncheck
- name: Vulnerability check
run: mise run vulncheck
72 changes: 45 additions & 27 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ jobs:
- "tests/**"
- "**/*.go"
- "go.*"
- "mise.toml"
- "mise.lock"
- ".golangci.yml"
- "main.go"
- ".github/actions/**"
- ".github/workflows/pr.yml"
deps:
- "go.mod"
- "go.sum"
- "mise.toml"
- "mise.lock"
- ".github/workflows/pr.yml"
workflows:
- ".github/workflows/**.yml"
Expand All @@ -46,7 +50,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
- uses: dhth/composite-actions/.github/actions/lint-go@main
- name: Set up mise
uses: jdx/mise-action@v4
with:
install_args: go golangci-lint
- name: Lint
run: mise run lint

build:
needs: changes
Expand All @@ -57,25 +66,25 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6.0.2
- name: Set up Go
uses: actions/setup-go@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
go-version-file: 'go.mod'
- name: go build
run: go build -v ./...
install_args: go
- name: Build
run: mise run build

test:
needs: changes
if: ${{ needs.changes.outputs.code == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
- name: Set up Go
uses: actions/setup-go@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
go-version-file: 'go.mod'
- name: go test
run: go test -v ./...
install_args: go
- name: Test
run: mise run test

lint-yaml:
needs: changes
Expand All @@ -84,7 +93,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- uses: dhth/composite-actions/.github/actions/lint-yaml@main
- name: Set up mise
uses: jdx/mise-action@v4
with:
install_args: yamlfmt
- name: Lint YAML
run: mise run lint:yaml

lint-workflows:
needs: changes
Expand All @@ -93,11 +107,17 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- uses: dhth/composite-actions/.github/actions/lint-actions@main
- name: Set up mise
uses: jdx/mise-action@v4
with:
install_args: actionlint
- name: Lint workflows
run: mise run lint:actions

back-compat:
needs: changes
if: ${{ needs.changes.outputs.code == 'true' }}
# Re-enable after mise is available in both compared revisions.
if: ${{ false && needs.changes.outputs.code == 'true' }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
Expand All @@ -108,20 +128,20 @@ jobs:
- uses: actions/checkout@v6.0.2
with:
ref: main
- name: Set up Go for main
uses: actions/setup-go@v6
- name: Set up mise for main
uses: jdx/mise-action@v4
with:
go-version-file: 'go.mod'
install_args: go
- name: build main
run: |
go build -o omm_main
cp omm_main /var/tmp
rm omm_main
- uses: actions/checkout@v6.0.2
- name: Set up Go for head
uses: actions/setup-go@v6
- name: Set up mise for head
uses: jdx/mise-action@v4
with:
go-version-file: 'go.mod'
install_args: go
- name: build head
run: |
go build -o omm_head
Expand All @@ -142,11 +162,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
- name: Set up Go
uses: actions/setup-go@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
go-version-file: 'go.mod'
- name: install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: govulncheck
run: govulncheck ./...
install_args: go go:golang.org/x/vuln/cmd/govulncheck
- name: Vulnerability check
run: mise run vulncheck
17 changes: 5 additions & 12 deletions .github/workflows/release-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,9 @@ jobs:
- uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
go-version-file: 'go.mod'
- name: Install Cosign
uses: sigstore/cosign-installer@v3
with:
cosign-release: 'v2.5.0'
- name: Release Binaries
uses: goreleaser/goreleaser-action@v7
with:
version: 'v2.14.1'
args: check
install_args: go goreleaser
- name: Release check
run: mise run release:check
17 changes: 5 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,11 @@ jobs:
- uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
go-version-file: 'go.mod'
- name: Install Cosign
uses: sigstore/cosign-installer@v3
with:
cosign-release: 'v2.5.0'
- name: Release Binaries
uses: goreleaser/goreleaser-action@v7
with:
version: 'v2.14.1'
args: release --clean
install_args: go goreleaser cosign
- name: Release binaries
run: mise run release
env:
GITHUB_TOKEN: ${{secrets.GH_PAT}}
13 changes: 5 additions & 8 deletions .github/workflows/scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
- name: Set up Go
uses: actions/setup-go@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
go-version-file: 'go.mod'
- name: Build Binaries
uses: goreleaser/goreleaser-action@v7
with:
version: 'v2.9.0'
args: build --snapshot
install_args: go goreleaser
- name: Build binaries
run: mise run release:build
- name: List binaries
run: |
ls -lh ./dist/omm_*/omm
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/vulncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
- name: Set up Go
uses: actions/setup-go@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
go-version-file: 'go.mod'
- name: install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: govulncheck
run: govulncheck ./...
install_args: go go:golang.org/x/vuln/cmd/govulncheck
- name: Vulnerability check
run: mise run vulncheck
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
omm
.quickrun
cosign.key
justfile
.notes
debug.log
tasks.txt
Expand Down
Loading