Skip to content

Commit a535ae2

Browse files
author
Jared Hall
committed
Add all sdks and run sample real tests
1 parent 835a028 commit a535ae2

3 files changed

Lines changed: 236 additions & 2 deletions

File tree

.github/workflows/integration.yml

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
name: SDK Integration Tests
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
8+
cli:
9+
name: CLI
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
repository: apialerts/cli
15+
ref: feature/1.3.0
16+
- uses: actions/setup-go@v5
17+
with:
18+
go-version: '1.22'
19+
- run: go build -o apialerts .
20+
- run: ./apialerts send --key $APIALERTS_API_KEY -m "CLI - minimal"
21+
env:
22+
APIALERTS_API_KEY: ${{ secrets.APIALERTS_TEST_API_KEY }}
23+
- run: ./apialerts send --key $APIALERTS_API_KEY -m "CLI - full" -e "sdk.test" -t "Integration Test" -c "developer" -g "CI/CD,CLI" -l "https://github.com/apialerts/cli/actions"
24+
env:
25+
APIALERTS_API_KEY: ${{ secrets.APIALERTS_TEST_API_KEY }}
26+
27+
csharp:
28+
name: C# SDK
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
repository: apialerts/apialerts-csharp
34+
ref: feature/2.0.0
35+
- uses: actions/setup-dotnet@v4
36+
with:
37+
dotnet-version: '8.0'
38+
- run: dotnet run --project sample
39+
env:
40+
APIALERTS_API_KEY: ${{ secrets.APIALERTS_TEST_API_KEY }}
41+
42+
dart:
43+
name: Dart SDK
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
with:
48+
repository: apialerts/apialerts-dart
49+
ref: feature/2.0.0
50+
- uses: dart-lang/setup-dart@v1
51+
- run: dart pub get
52+
- run: dart run sample/run.dart
53+
env:
54+
APIALERTS_API_KEY: ${{ secrets.APIALERTS_TEST_API_KEY }}
55+
56+
go:
57+
name: Go SDK
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v4
61+
with:
62+
repository: apialerts/apialerts-go
63+
ref: feature/2.0.0
64+
- uses: actions/setup-go@v5
65+
with:
66+
go-version: '1.22'
67+
- run: go run sample/github.go
68+
env:
69+
APIALERTS_API_KEY: ${{ secrets.APIALERTS_TEST_API_KEY }}
70+
71+
godot:
72+
name: Godot SDK
73+
runs-on: ubuntu-latest
74+
steps:
75+
- uses: actions/checkout@v4
76+
with:
77+
repository: apialerts/apialerts-godot
78+
ref: feature/2.0.0
79+
- name: Download Godot
80+
run: |
81+
wget -q https://github.com/godotengine/godot/releases/download/4.3-stable/Godot_v4.3-stable_linux.x86_64.zip
82+
unzip -q Godot_v4.3-stable_linux.x86_64.zip
83+
mv Godot_v4.3-stable_linux.x86_64 godot
84+
chmod +x godot
85+
- name: Run sample
86+
run: ./godot --headless --path . --script sample/sample.gd
87+
env:
88+
APIALERTS_API_KEY: ${{ secrets.APIALERTS_TEST_API_KEY }}
89+
90+
js:
91+
name: JS SDK
92+
runs-on: ubuntu-latest
93+
steps:
94+
- uses: actions/checkout@v4
95+
with:
96+
repository: apialerts/apialerts-js
97+
ref: feature/2.0.0
98+
- uses: actions/setup-node@v4
99+
with:
100+
node-version: '22'
101+
- run: npm install --legacy-peer-deps
102+
- run: npx tsx sample/run.ts
103+
env:
104+
APIALERTS_API_KEY: ${{ secrets.APIALERTS_TEST_API_KEY }}
105+
106+
kotlin:
107+
name: Kotlin SDK
108+
runs-on: ubuntu-latest
109+
steps:
110+
- uses: actions/checkout@v4
111+
with:
112+
repository: apialerts/apialerts-kotlin
113+
ref: feature/2.0.0
114+
- uses: actions/setup-java@v4
115+
with:
116+
java-version: '21'
117+
distribution: 'temurin'
118+
- run: ./gradlew :sample:run
119+
env:
120+
APIALERTS_API_KEY: ${{ secrets.APIALERTS_TEST_API_KEY }}
121+
122+
php:
123+
name: PHP SDK
124+
runs-on: ubuntu-latest
125+
steps:
126+
- uses: actions/checkout@v4
127+
with:
128+
repository: apialerts/apialerts-php
129+
ref: feature/2.0.0
130+
- uses: shivammathur/setup-php@v2
131+
with:
132+
php-version: '8.3'
133+
- run: composer install --no-interaction
134+
- run: php sample/run.php
135+
env:
136+
APIALERTS_API_KEY: ${{ secrets.APIALERTS_TEST_API_KEY }}
137+
138+
python:
139+
name: Python SDK
140+
runs-on: ubuntu-latest
141+
steps:
142+
- uses: actions/checkout@v4
143+
with:
144+
repository: apialerts/apialerts-python
145+
ref: feature/2.0.0
146+
- uses: actions/setup-python@v5
147+
with:
148+
python-version: '3.12'
149+
- run: pip install .
150+
- run: python sample/run.py
151+
env:
152+
APIALERTS_API_KEY: ${{ secrets.APIALERTS_TEST_API_KEY }}
153+
154+
ruby:
155+
name: Ruby SDK
156+
runs-on: ubuntu-latest
157+
steps:
158+
- uses: actions/checkout@v4
159+
with:
160+
repository: apialerts/apialerts-ruby
161+
ref: feature/2.0.0
162+
- uses: ruby/setup-ruby@v1
163+
with:
164+
ruby-version: '3.3'
165+
bundler-cache: true
166+
- run: ruby sample/run.rb
167+
env:
168+
APIALERTS_API_KEY: ${{ secrets.APIALERTS_TEST_API_KEY }}
169+
170+
rust:
171+
name: Rust SDK
172+
runs-on: ubuntu-latest
173+
steps:
174+
- uses: actions/checkout@v4
175+
with:
176+
repository: apialerts/apialerts-rust
177+
ref: feature/2.0.0
178+
- uses: dtolnay/rust-toolchain@stable
179+
- run: cargo run --example run
180+
env:
181+
APIALERTS_API_KEY: ${{ secrets.APIALERTS_TEST_API_KEY }}
182+
183+
swift:
184+
name: Swift SDK
185+
runs-on: macos-latest
186+
steps:
187+
- uses: actions/checkout@v4
188+
with:
189+
repository: apialerts/apialerts-swift
190+
ref: feature/2.0.0
191+
- run: swift run --package-path sample
192+
env:
193+
APIALERTS_API_KEY: ${{ secrets.APIALERTS_TEST_API_KEY }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

README.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,42 @@
1-
# integration-tests
2-
Tests for all apialerts sdks
1+
# Integration Tests
2+
3+
End-to-end integration tests for all APIAlerts SDKs. Runs each SDK against the live API using a dedicated test workspace.
4+
5+
## How it works
6+
7+
Each CI job checks out an SDK repo and runs its `sample/` script with a shared test API key. No code lives in this repo beyond the workflow — all sample logic lives in the SDK repos themselves.
8+
9+
Each sample sends two events:
10+
1. **Minimal**`message` only, validates optional fields are truly optional
11+
2. **Full** — all fields (`message`, `channel`, `event`, `title`, `tags`, `link`, `data`)
12+
13+
## Triggers
14+
15+
- **Nightly** — 2am UTC via cron
16+
- **Manual**`workflow_dispatch`, run before any coordinated v2.0 release
17+
18+
## Secret required
19+
20+
`APIALERTS_TEST_API_KEY` — API key for a dedicated test workspace. Set in this repo's GitHub Actions secrets.
21+
22+
## Adding a new SDK
23+
24+
1. Add a `sample/` directory to the SDK repo with a script that sends a minimal and full event
25+
2. Uncomment the corresponding job in `.github/workflows/integration.yml`
26+
3. The Go SDK (`apialerts-go/sample/github.go`) is the reference implementation
27+
28+
## Status
29+
30+
| SDK | Sample ready | Job active |
31+
|-----|-------------|------------|
32+
| Go |||
33+
| PHP |||
34+
| JS |||
35+
| Python |||
36+
| Kotlin |||
37+
| Swift |||
38+
| C# |||
39+
| Rust |||
40+
| Dart |||
41+
| Ruby |||
42+
| Godot |||

0 commit comments

Comments
 (0)