Skip to content

Commit 793aa5d

Browse files
author
Reuben Brooks
committed
Merge scud-go: Go CI workflows
2 parents 6350fc3 + 3a5e418 commit 793aa5d

File tree

4 files changed

+44
-200
lines changed

4 files changed

+44
-200
lines changed

.github/workflows/coverage.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 31 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,63 +8,57 @@ on:
88

99
jobs:
1010
build:
11-
name: Build ${{ matrix.asset_name }}
11+
name: Build ${{ matrix.goos }}/${{ matrix.goarch }}
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
fail-fast: false
1515
matrix:
1616
include:
1717
- os: ubuntu-latest
18-
target: x86_64-unknown-linux-gnu
19-
artifact_name: scud
20-
asset_name: scud-linux-x64
21-
use_cross: false
18+
goos: linux
19+
goarch: amd64
20+
asset_name: scud-linux-amd64
2221
- os: ubuntu-latest
23-
target: aarch64-unknown-linux-gnu
24-
artifact_name: scud
22+
goos: linux
23+
goarch: arm64
2524
asset_name: scud-linux-arm64
26-
use_cross: true
2725
- os: macos-latest
28-
target: x86_64-apple-darwin
29-
artifact_name: scud
30-
asset_name: scud-macos-x64
31-
use_cross: false
26+
goos: darwin
27+
goarch: amd64
28+
asset_name: scud-darwin-amd64
3229
- os: macos-latest
33-
target: aarch64-apple-darwin
34-
artifact_name: scud
35-
asset_name: scud-macos-arm64
36-
use_cross: false
30+
goos: darwin
31+
goarch: arm64
32+
asset_name: scud-darwin-arm64
3733
- os: windows-latest
38-
target: x86_64-pc-windows-msvc
39-
artifact_name: scud.exe
40-
asset_name: scud-windows-x64.exe
41-
use_cross: false
34+
goos: windows
35+
goarch: amd64
36+
asset_name: scud-windows-amd64.exe
37+
- os: windows-latest
38+
goos: windows
39+
goarch: arm64
40+
asset_name: scud-windows-arm64.exe
4241

4342
steps:
4443
- uses: actions/checkout@v4
4544

46-
- name: Install Rust
47-
uses: dtolnay/rust-toolchain@stable
45+
- name: Set up Go
46+
uses: actions/setup-go@v5
4847
with:
49-
targets: ${{ matrix.target }}
50-
51-
- name: Install cross
52-
if: matrix.use_cross
53-
run: cargo install cross --git https://github.com/cross-rs/cross
48+
go-version-file: go.mod
5449

55-
- name: Build with cross
56-
if: matrix.use_cross
57-
run: cross build --release --target ${{ matrix.target }} -p scud-cli
58-
59-
- name: Build with cargo
60-
if: "!matrix.use_cross"
61-
run: cargo build --release --target ${{ matrix.target }} -p scud-cli
50+
- name: Build
51+
env:
52+
GOOS: ${{ matrix.goos }}
53+
GOARCH: ${{ matrix.goarch }}
54+
CGO_ENABLED: "0"
55+
run: go build -ldflags="-s -w" -o ${{ matrix.asset_name }} ./cmd/scud/
6256

63-
- name: Upload binary
57+
- name: Upload artifact
6458
uses: actions/upload-artifact@v4
6559
with:
6660
name: ${{ matrix.asset_name }}
67-
path: target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
61+
path: ${{ matrix.asset_name }}
6862

6963
release:
7064
name: Create Release
@@ -81,7 +75,7 @@ jobs:
8175
path: ./artifacts
8276

8377
- name: Create Release
84-
run: gh release create ${{ github.ref_name }} --title "Release ${{ github.ref_name }}" --generate-notes
78+
run: gh release create ${{ github.ref_name }} --title "${{ github.ref_name }}" --generate-notes
8579
env:
8680
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8781

.github/workflows/test.yml

Lines changed: 13 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -2,94 +2,31 @@ name: Test
22

33
on:
44
push:
5-
branches: [ master, main ]
5+
branches: [master, main]
66
pull_request:
7-
branches: [ master, main ]
8-
schedule:
9-
# Run weekly integration tests on Sundays at midnight UTC
10-
- cron: '0 0 * * 0'
11-
12-
env:
13-
CARGO_TERM_COLOR: always
7+
branches: [master, main]
148

159
jobs:
1610
test:
1711
name: Test on ${{ matrix.os }}
1812
runs-on: ${{ matrix.os }}
1913
strategy:
2014
matrix:
21-
os: [ubuntu-latest, macos-latest]
22-
rust: [stable]
15+
os: [ubuntu-latest, macos-latest, windows-latest]
2316

2417
steps:
25-
- name: Checkout code
26-
uses: actions/checkout@v4
18+
- uses: actions/checkout@v4
2719

28-
- name: Install Rust
29-
uses: actions-rs/toolchain@v1
20+
- name: Set up Go
21+
uses: actions/setup-go@v5
3022
with:
31-
toolchain: ${{ matrix.rust }}
32-
override: true
33-
components: rustfmt, clippy
34-
35-
- name: Run unit tests
36-
run: |
37-
cd scud-cli
38-
cargo test --lib
39-
40-
- name: Run E2E tests (mock mode)
41-
run: |
42-
cd scud-cli
43-
cargo test --test main
44-
45-
- name: Run clippy
46-
run: |
47-
cd scud-cli
48-
cargo clippy --all-targets --all-features -- -D warnings
49-
50-
- name: Check formatting
51-
run: |
52-
cd scud-cli
53-
cargo fmt -- --check
54-
55-
- name: Build release binary
56-
run: |
57-
cd scud-cli
58-
cargo build --release
23+
go-version-file: go.mod
5924

60-
- name: Verify feature flags compile
61-
run: |
62-
cd scud-cli
63-
cargo build --features real-llm
64-
cargo build --features real-terminal
65-
cargo build --features "real-llm real-terminal"
25+
- name: Run tests
26+
run: go test ./...
6627

67-
- name: Test Node.js wrapper
68-
run: |
69-
cd scud-cli
70-
npm install
71-
./bin/scud.js help
72-
73-
# Weekly integration tests with real LLM APIs
74-
integration:
75-
name: Integration Tests (Real APIs)
76-
runs-on: ubuntu-latest
77-
if: github.event_name == 'schedule'
78-
79-
steps:
80-
- name: Checkout code
81-
uses: actions/checkout@v4
82-
83-
- name: Install Rust
84-
uses: actions-rs/toolchain@v1
85-
with:
86-
toolchain: stable
87-
override: true
28+
- name: Build
29+
run: go build ./cmd/scud/
8830

89-
- name: Run integration tests with real LLM
90-
if: ${{ secrets.XAI_API_KEY != '' }}
91-
env:
92-
XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
93-
run: |
94-
cd scud-cli
95-
cargo test --test main --features real-llm -- --ignored
31+
- name: Vet
32+
run: go vet ./...

0 commit comments

Comments
 (0)