ci: comment review-binary download link on PRs, add Windows build #84
Workflow file for this run
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: 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 liftoff-export | |
| run: go build -o /tmp/liftoff-export . | |
| - name: run compat suite | |
| env: | |
| # Path the compat-tagged test reads from os.Getenv. | |
| LIFTOFF_EXPORT_BIN: /tmp/liftoff-export | |
| run: go test -tags=compat -run TestContractFormats ./... | |
| artifacts: | |
| # Cross-compile review binaries for the platforms reviewers actually use. | |
| # Goreleaser owns tagged releases; this job exists so a PR's diff can be | |
| # tried end-to-end without a local Go toolchain — download from the run | |
| # page, chmod +x, run. Retention is short (14d) to keep storage tidy. | |
| name: review binaries | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: cross-compile | |
| run: | | |
| mkdir -p dist | |
| for target in darwin/arm64 darwin/amd64 linux/amd64 linux/arm64 windows/amd64; do | |
| os="${target%/*}"; arch="${target#*/}" | |
| ext=""; [ "$os" = "windows" ] && ext=".exe" | |
| GOOS=$os GOARCH=$arch go build -trimpath -ldflags="-s -w" \ | |
| -o "dist/liftoff-export-${os}-${arch}${ext}" . | |
| done | |
| ls -lh dist/ | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: liftoff-export | |
| path: dist/ | |
| retention-days: 14 | |
| if-no-files-found: error |