Repository navigation
110 lines (106 loc) · 3.77 KB
/
Copy pathci.yml
File metadata and controls
110 lines (106 loc) · 3.77 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
name: Etcd Client Test
run-name: ${{ github.actor }} is testing out etcd client
on:
pull_request:
branches: [ '**' ]
push:
branches: [ '**' ]
env:
CARGO_TERM_COLOR: always
jobs:
lint:
name: lint (${{ matrix.partition }}/8)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
partition: [1, 2, 3, 4, 5, 6, 7, 8]
steps:
- uses: actions/checkout@v7
- run: sudo apt install -y protobuf-compiler libprotobuf-dev
- uses: Swatinem/rust-cache@v2
with:
key: clippy-${{ matrix.partition }}
- uses: taiki-e/install-action@cargo-hack
- name: format check
if: matrix.partition == 1
run: cargo fmt --check
- name: clippy
run: >
cargo hack --feature-powerset
--partition ${{ matrix.partition }}/8
--mutually-exclusive-features tls-ring,tls-aws-lc,tls-openssl
--mutually-exclusive-features tls-native-roots,tls-openssl
--mutually-exclusive-features tls-webpki-roots,tls-openssl clippy
--exclude-features _tls,tls-openssl-vendored
--all-targets
--
-D warnings
regression-test:
name: etcd ${{ matrix.etcd }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- etcd: v3.5.26
- etcd: v3.6.15
- etcd: v3.7.2
max_request_bytes: 10204
steps:
- name: Start etcd
run: >
sudo docker run -d --name etcd-server
--publish 2379:2379
--publish 2380:2380
--env ETCD_AUTH_TOKEN_TTL=2
--env ALLOW_NONE_AUTHENTICATION=yes
--env ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379
--env ETCD_ADVERTISE_CLIENT_URLS=http://localhost:2379
--env ETCD_MAX_REQUEST_BYTES=${{ matrix.max_request_bytes || 1572864 }}
quay.io/coreos/etcd:${{ matrix.etcd }}
- run: sudo docker exec etcd-server etcdctl member list -w table
- run: sudo docker exec etcd-server etcdctl endpoint status -w table
# Create and grant a testing user.
- run: sudo docker exec etcd-server etcdctl user add --new-user-password="rootpwd" root
- run: sudo docker exec etcd-server etcdctl user grant-role root root
- run: curl -v http://localhost:2379/health
- run: sudo apt install -y protobuf-compiler libprotobuf-dev
- uses: actions/checkout@v7
- uses: Swatinem/rust-cache@v2
- name: unit test
run: cargo test
- name: test get stream chunked
if: matrix.max_request_bytes
run: cargo test --test client test_get_stream -- --ignored
- run: cargo run --example kv
- run: cargo run --example lease
- run: cargo run --example lock
- run: cargo run --example maintenance
- run: cargo run --example watch
- run: cargo run --example election
- run: cargo run --example auth_role
- run: cargo run --example auth_user
# run: cargo run --example cluster
cluster-test:
name: cluster etcd ${{ matrix.etcd }}
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
etcd: [v3.5.26, v3.6.15, v3.7.2]
steps:
- uses: actions/checkout@v7
- run: .github/scripts/etcd-cluster.sh up ${{ matrix.etcd }}
# Waits in the background for test_cluster to add node4, then starts it.
- run: nohup .github/scripts/etcd-cluster.sh join ${{ matrix.etcd }} > join.log 2>&1 &
- run: sudo apt install -y protobuf-compiler libprotobuf-dev
- uses: Swatinem/rust-cache@v2
- name: cluster test
run: cargo test --test client test_cluster -- --ignored
- name: etcd logs
if: failure()
run: |
cat join.log
for n in 1 2 3 4; do docker logs node$n || true; done