-
Notifications
You must be signed in to change notification settings - Fork 19
88 lines (85 loc) · 2.49 KB
/
basic-ci.yaml
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
name: Harvester-Node-Disk-Manager CI
# synchronize for pull request update
on:
push:
branches:
- master
- 'v**'
pull_request:
types: [opened, reopened, synchronize]
env:
LIBVIRT_DEFAULT_URI: "qemu:///system"
jobs:
validation:
runs-on:
- self-hosted
- golang
steps:
- name: "Clone and check"
uses: actions/checkout@v3
- name: "Run validations"
run: |
make validate
make validate-ci
main_jobs:
needs: validation
runs-on:
- self-hosted
- golang
steps:
- name: "Clone and check"
uses: actions/checkout@v3
- name: "Build the Image for the Integration Test"
run: |
BUILD_FOR_CI=true make
./ci/scripts/patch-ttl-repo.sh
echo "NDM override result as below:"
cat ci/charts/ndm-override.yaml
- name: "Local Deployment (Harvester+Longhorn+Node-Disk-Manager) for testing"
id: vm_deploy
run: |
rm -rf ndm-vagrant-rancherd
git clone https://github.com/harvester/vagrant-rancherd ndm-vagrant-rancherd
pushd ndm-vagrant-rancherd
./new_cluster.sh
yq e -i ".longhorn_version = \"1.5.3\"" settings.yaml
./scripts/deploy_longhorn.sh
cp ../ci/scripts/deploy_ndm.sh ./deploy_ndm.sh
./deploy_ndm.sh
popd
- name: "Add disk"
run: |
pushd ndm-vagrant-rancherd
./scripts/attach-disk.sh node1
sleep 30
popd
- name: "Patch Image target (for upgrade)"
run: |
./ci/scripts/patch-ttl-repo.sh
echo "NDM override result as below:"
cat ci/charts/ndm-override.yaml
- name: "Upgrade NDM"
run: |
pushd ndm-vagrant-rancherd
cp ../ci/scripts/upgrade_ndm.sh ./upgrade_ndm.sh
./upgrade_ndm.sh
popd
- name: "Run Basic Test"
id: basic-test
run: |
pushd ndm-vagrant-rancherd
vagrant ssh-config node1 > ../ssh-config
cp kubeconfig ../kubeconfig
popd
echo Running integration tests
NDM_HOME=`pwd` go test -v ./tests/...
- name: "Get NDM logs"
if: steps.vm_deploy.conclusion == 'success'
run: |
./ci/scripts/get-debug-info.sh
- name: "Tear Down / Cleanup"
if: steps.vm_deploy.conclusion == 'success'
run: |
pushd ndm-vagrant-rancherd
vagrant destroy -f --parallel
popd