-
Notifications
You must be signed in to change notification settings - Fork 32
109 lines (98 loc) · 3.38 KB
/
Copy pathlambda-k8s.yml
File metadata and controls
109 lines (98 loc) · 3.38 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
name: K8s Backends
on:
push:
branches: [main]
paths:
- 'crates/fakecloud-lambda/**'
- 'crates/fakecloud-elasticache/**'
- 'crates/fakecloud-rds/**'
- 'crates/fakecloud-ecs/**'
- 'crates/fakecloud-ec2/**'
- 'crates/fakecloud-k8s/**'
- '.github/workflows/lambda-k8s.yml'
pull_request:
branches: [main]
paths:
- 'crates/fakecloud-lambda/**'
- 'crates/fakecloud-elasticache/**'
- 'crates/fakecloud-rds/**'
- 'crates/fakecloud-ecs/**'
- 'crates/fakecloud-ec2/**'
- 'crates/fakecloud-k8s/**'
- '.github/workflows/lambda-k8s.yml'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
jobs:
k8s-integration:
name: K8s backend (kind)
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- name: Create kind cluster
uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1.14.0
with:
cluster_name: fakecloud-k8s-test
# Single node is enough — these tests exercise control-plane
# interactions (create/list/delete pods, reap orphans by label)
# plus exec into a real redis pod. Multi-node would just slow boot.
wait: 120s
- name: Pre-pull images into the cluster
run: |
pull() {
for i in 1 2 3; do
docker pull "$1" && return 0
echo "docker pull $1 attempt $i failed; retrying"; sleep $((i * 5))
done
echo "docker pull $1 failed after 3 attempts"; return 1
}
for img in registry.k8s.io/pause:3.10 redis:7-alpine postgres:16-alpine busybox:1.36; do
pull "$img"
kind load docker-image "$img" --name fakecloud-k8s-test
done
- name: Lambda K8s integration tests
env:
FAKECLOUD_K8S_TEST: '1'
run: |
cargo test -p fakecloud-lambda \
--features k8s-integration \
--test k8s_integration \
-- --test-threads=1
- name: ElastiCache K8s integration tests
env:
FAKECLOUD_K8S_TEST: '1'
run: |
cargo test -p fakecloud-elasticache \
--features k8s-integration \
--test k8s_integration \
-- --test-threads=1
- name: RDS K8s integration tests
env:
FAKECLOUD_K8S_TEST: '1'
run: |
cargo test -p fakecloud-rds \
--features k8s-integration \
--test k8s_integration \
-- --test-threads=1
- name: ECS K8s integration tests
env:
FAKECLOUD_K8S_TEST: '1'
run: |
cargo test -p fakecloud-ecs \
--features k8s-integration \
--test k8s_integration \
-- --test-threads=1
- name: EC2 K8s integration tests
env:
FAKECLOUD_K8S_TEST: '1'
run: |
cargo test -p fakecloud-ec2 \
--features k8s-integration \
--test k8s_integration \
-- --test-threads=1