forked from dotandev/hintents
-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (106 loc) · 5.33 KB
/
Copy pathintegration.yml
File metadata and controls
125 lines (106 loc) · 5.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Integration Tests – Cross-Platform Binary
on:
push:
branches: ["main", "develop"]
pull_request:
branches: ["main", "develop"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# ─────────────────────────────────────────────────────────────────────────────
# Matrix: Linux · macOS Intel · macOS Apple Silicon · Windows
# ─────────────────────────────────────────────────────────────────────────────
jobs:
integration:
name: Integration / ${{ matrix.os }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false # run all platforms even if one fails
matrix:
include:
- os: Linux
runner: ubuntu-24.04
binary_suffix: ""
go_arch: amd64
- os: macOS-Intel
runner: macos-latest # Intel runner (fallback to latest if 13 fails)
binary_suffix: ""
go_arch: amd64
- os: macOS-Apple-Silicon
runner: macos-latest # M-series ARM runner
binary_suffix: ""
go_arch: arm64
- os: Windows
runner: windows-2022
binary_suffix: ".exe"
go_arch: amd64
env:
# Allow the test suite to find the compiled binary without hard-coding a path.
ERST_BINARY: ${{ github.workspace }}/erst${{ matrix.binary_suffix }}
steps:
# ── Checkout ──────────────────────────────────────────────────────────
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
# ── Go toolchain ──────────────────────────────────────────────────────
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
# ── Rust toolchain (for the Soroban simulator) ─────────────────────────
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Cache Rust build artefacts
uses: Swatinem/rust-cache@v2
with:
workspaces: simulator -> target
# ── Build erst binary ──────────────────────────────────────────────────
- name: Build erst (Go CLI)
run: |
go build -v -o "${{ env.ERST_BINARY }}" ./cmd/erst
# ── Build Rust simulator ───────────────────────────────────────────────
- name: Build erst-sim (Rust simulator)
working-directory: simulator
run: cargo build --release
# ── Verify binary is executable ────────────────────────────────────────
- name: Smoke-test binary (--version)
run: ${{ env.ERST_BINARY }} --version
# ── Unit tests (fast gate before integration) ─────────────────────────
- name: Run Go unit tests
run: go test -v -race ./...
# ── Integration test suite ─────────────────────────────────────────────
- name: Run integration tests
run: |
go test -v -race -timeout 120s ./integration/...
env:
ERST_BINARY: ${{ env.ERST_BINARY }}
# ── Upload test results on failure ────────────────────────────────────
- name: Upload test logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-logs-${{ matrix.os }}
path: |
**/*.log
**/test-output.txt
retention-days: 7
# ─────────────────────────────────────────────────────────────────────────
# Summary job – required status check for branch protection
# ─────────────────────────────────────────────────────────────────────────
integration-complete:
name: Integration complete
runs-on: ubuntu-24.04
needs: integration
if: always()
steps:
- name: Check all matrix jobs passed
run: |
if [ "${{ needs.integration.result }}" != "success" ]; then
echo "One or more platform integration jobs failed."
exit 1
fi
echo "All platform integration jobs passed."