Skip to content

Commit 85f025e

Browse files
authored
Add e2e-cli for E2E testing (#142)
* Add e2e-cli for E2E testing * Fix e2e-cli: target net10.0, pass cdnHost, override SegmentURL scheme * Add e2e workflows and restrict test suites to basic
1 parent f7fc185 commit 85f025e

7 files changed

Lines changed: 582 additions & 0 deletions

File tree

.github/workflows/e2e-tests.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: E2E Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
inputs:
10+
e2e_tests_ref:
11+
description: 'Branch or ref of sdk-e2e-tests to use'
12+
required: false
13+
default: 'main'
14+
15+
jobs:
16+
e2e-tests:
17+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout SDK
22+
uses: actions/checkout@v4
23+
with:
24+
path: sdk
25+
26+
- name: Checkout sdk-e2e-tests
27+
uses: actions/checkout@v4
28+
with:
29+
repository: segmentio/sdk-e2e-tests
30+
ref: ${{ inputs.e2e_tests_ref || 'main' }}
31+
token: ${{ secrets.E2E_TESTS_TOKEN }}
32+
path: sdk-e2e-tests
33+
34+
- name: Setup .NET
35+
uses: actions/setup-dotnet@v4
36+
with:
37+
dotnet-version: '10.0.x'
38+
39+
- name: Setup Node.js
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: '20'
43+
44+
- name: Build e2e-cli
45+
working-directory: sdk/e2e-cli
46+
run: dotnet build -c Release -o build
47+
48+
- name: Run E2E tests
49+
working-directory: sdk-e2e-tests
50+
run: |
51+
./scripts/run-tests.sh \
52+
--sdk-dir "${{ github.workspace }}/sdk/e2e-cli" \
53+
--cli "dotnet ${{ github.workspace }}/sdk/e2e-cli/build/e2e-cli.dll"
54+
55+
- name: Upload test results
56+
if: always()
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: e2e-test-results
60+
path: sdk-e2e-tests/test-results/
61+
if-no-files-found: ignore
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish E2E CLI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'e2e-cli/**'
8+
- 'Analytics-CSharp/**'
9+
schedule:
10+
- cron: '0 0 1 * *'
11+
workflow_dispatch:
12+
13+
jobs:
14+
publish:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout SDK
18+
uses: actions/checkout@v4
19+
20+
- name: Setup .NET
21+
uses: actions/setup-dotnet@v4
22+
with:
23+
dotnet-version: '10.0.x'
24+
25+
- name: Build e2e-cli
26+
working-directory: e2e-cli
27+
run: dotnet build -c Release -o build
28+
29+
- name: Upload CLI artifact
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: e2e-cli-csharp
33+
path: e2e-cli/build/
34+
retention-days: 90

0 commit comments

Comments
 (0)