-
Notifications
You must be signed in to change notification settings - Fork 3
107 lines (85 loc) · 2.93 KB
/
Copy pathintegration-test.yaml
File metadata and controls
107 lines (85 loc) · 2.93 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
name: "Integration Test"
on:
pull_request:
push:
branches:
- main
- develop
workflow_dispatch:
env:
REPO_USERNAME: ${{ github.actor }}
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
permissions:
contents: read
packages: write
jobs:
# Build and push all components
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Nix environment
uses: ./.github/actions/setup-nix
with:
nixbuild_key: ${{ secrets.NIXBUILD_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build and push all components sequentially to reuse Nix store
- name: Build and push Lix image
run: |
nix run --file liximage.nix push
- name: Build and push environments
run: |
nix run --file default.nix push
- name: Build and push scratch image
run: |
nix build --file default.nix uploadScratch
sudo -E ./result/bin/uploadScratch
# Test deployment on Kind cluster
test-kind:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Nix environment
uses: ./.github/actions/setup-nix
with:
nixbuild_key: ${{ secrets.NIXBUILD_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Kind cluster
uses: helm/kind-action@v1
- name: Generate SSH keys
run: |
ssh-keygen -t ed25519 -f keys/ci-test -N "" -C "ci-test"
- name: Deploy nix-csi
run: |
nix run --file . kubenixApply.deploymentScript --argstr local "true"
- name: Wait for nix-csi cache pod
run: |
kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=cache -n nix-csi --timeout=300s
- name: Wait for nix-csi node daemonset
run: |
kubectl rollout status daemonset/nix-node -n nix-csi --timeout=300s
- name: Wait for test workload
run: |
kubectl wait --for=condition=ready pod -l app=ctest -n nix-csi --timeout=300s
# - name: Run integration tests
# run: |
# nix run --file . integrationTest
- name: Debug on failure
if: failure()
run: |
echo "=== Pods in nix-csi namespace ==="
kubectl get pods -n nix-csi -o wide
echo "=== CSI driver info ==="
kubectl get csidrivers
echo "=== Cache pod logs ==="
kubectl logs -l app.kubernetes.io/name=cache -n nix-csi --tail=100 || true
echo "=== Node pod logs ==="
kubectl logs -l app.kubernetes.io/name=csi -n nix-csi --tail=100 --all-containers || true
echo "=== Test pod logs ==="
kubectl logs -l app=ctest -n nix-csi --tail=100 || true
echo "=== Events ==="
kubectl get events -n nix-csi --sort-by='.lastTimestamp'