Skip to content

Commit dea4114

Browse files
github: Add integration test job that runs with etcd service container
1 parent 1361d5f commit dea4114

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/pull_request.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,38 @@ jobs:
2121
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
2222
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
2323

24+
# Integration tests use a running etcd so this job uses a service container.
25+
integration-tests:
26+
name: Integration tests
27+
runs-on: ubuntu-latest
28+
services:
29+
etcd:
30+
image: quay.io/coreos/etcd:v3.5.6
31+
env:
32+
ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379
33+
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379
34+
ETCD_INITIAL_CLUSTER_STATE: new
35+
ports:
36+
- 2379:2379
37+
container:
38+
image: swift:6.0-noble
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
42+
with:
43+
persist-credentials: false
44+
- name: Build package
45+
run: swift build --build-tests
46+
- name: Run integration tests
47+
shell: bash # explicitly choose bash, which ensures -o pipefail
48+
run: swift test --filter "IntegrationTests" | tee test.out
49+
env:
50+
SWIFT_ETCD_CLIENT_INTEGRATION_TEST_ENABLED: true
51+
ETCD_HOST: etcd
52+
ETCD_PORT: 2379
53+
- name: Check integration tests actually did run
54+
run: test -r test.out && ! grep -i -e "executed 0 tests" -e "skipped" test.out
55+
2456
cxx-interop:
2557
name: Cxx interop
2658
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main

0 commit comments

Comments
 (0)