-
Notifications
You must be signed in to change notification settings - Fork 9
89 lines (73 loc) · 2.62 KB
/
e2e.yml
File metadata and controls
89 lines (73 loc) · 2.62 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
name: Run E2E Test
on:
push:
branches: [main, release-*]
paths-ignore: ['**.md', '**.png', '**.jpg', '**.svg', '**/docs/**']
pull_request:
branches: [main, release-*]
paths-ignore: ['**.md', '**.png', '**.jpg', '**.svg', '**/docs/**']
schedule:
- cron: '0 4 * * *'
jobs:
run-e2e-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-docker-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-docker-buildx-
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker Image
uses: docker/build-push-action@v5
with:
context: .
file: ./build/Dockerfile
tags: model-csi-driver:latest
load: true
push: false
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Move Docker Build Cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache || true
- name: Install Kind
run: |
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.30.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind
- name: Create Kind Cluster
run: |
kind create cluster --wait 120s
- name: Load docker image into kind
run: |
kind load docker-image model-csi-driver:latest
- name: Install Helm
run: |
curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
- name: Check cluster and helm
run: |
kubectl get nodes
kubectl cluster-info
helm version
- name: Deploy model-csi-driver chart
run: |
sed -i "s/VERSION/0.1.0/g" charts/model-csi-driver/Chart.yaml
helm upgrade --install model-csi-driver ./charts/model-csi-driver --namespace model-csi --create-namespace
- name: Wait for model-csi-driver pods to be ready
run: |
kubectl wait --for=condition=Ready pods --all --namespace model-csi --timeout=120s
- name: Run Test Pod
run: |
kubectl apply -f test/testdata/pod.test.yaml
kubectl wait --for=condition=Ready pod/model-csi-driver-test --timeout=120s
kubectl delete pod model-csi-driver-test
# # Keep for debug purpose
# - name: Start tmate session
# uses: mxschmitt/action-tmate@v3