Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
go:
name: go vet + test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: go vet
run: go vet ./...
- name: go test
run: go test ./...

compat:
name: compat (CONTRACT machine-attestation)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: resolve compat dependency
# The compat module lives at github.com/quantcli/common/compat
# under a subpath. `go mod tidy` materializes go.sum for it on
# first run; subsequent runs are cache-served.
run: go mod tidy
- name: build crono-export
run: go build -o /tmp/crono-export .
- name: run compat suite
env:
# Path the compat-tagged test reads from os.Getenv.
CRONO_EXPORT_BIN: /tmp/crono-export
run: go test -tags=compat -run TestContractDates ./...
28 changes: 28 additions & 0 deletions compat_contract_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//go:build compat

// Compat-test entry point for crono-export-cli.
//
// This file is only compiled under the `compat` build tag, so it does
// not affect the default `go test ./...` run. CI invokes it as
// `go test -tags=compat ./...` after building the export binary and
// exposing its path through CRONO_EXPORT_BIN.
//
// The actual assertions live in github.com/quantcli/common/compat.
// Drift between this CLI and CONTRACT.md surfaces as a failure here.
package main_test

import (
"os"
"testing"

"github.com/quantcli/common/compat"
"github.com/quantcli/common/compat/dates"
)

func TestContractDates(t *testing.T) {
bin := os.Getenv("CRONO_EXPORT_BIN")
if bin == "" {
t.Skip("CRONO_EXPORT_BIN not set; skipping compat suite")
}
dates.RunContract(t, compat.Runner{Binary: bin})
}
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go 1.25.5

require (
github.com/jrmycanady/gocronometer v1.5.1
github.com/quantcli/common/compat v0.0.0-20260510223424-1882283f6817
github.com/spf13/cobra v1.10.2
)

Expand Down
Loading