-
Notifications
You must be signed in to change notification settings - Fork 72
170 lines (144 loc) · 4.92 KB
/
test-on-push.yml
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: Tests
on:
push:
pull_request:
workflow_dispatch:
jobs:
test-main:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Build Fablo
run: |
shellcheck --version && \
yamllint -v && \
npm install && \
npm run build && \
./fablo-build.sh
- name: Test simple network
run: e2e-network/docker/test-01-simple.sh
- uses: actions/upload-artifact@v2
if: always()
with:
name: test-main
path: |
e2e-network/docker/test-01-simple.sh.logs/*
e2e-network/docker/test-01-simple.sh.tmpdir/fablo-target/**/*
- name: Test generators
run: |
npm run test:unit && \
npm run test:e2e && \
./check-if-fablo-version-matches.sh
- name: Lint
run: npm run lint && ./lint.sh
test-k8:
needs: test-main
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: install k8, hlf plugin and helm
run: |
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.14.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind
kind create cluster --wait 5m
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
set -x; cd "$(mktemp -d)" &&
OS="$(uname | tr '[:upper:]' '[:lower:]')" &&
ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" &&
KREW="krew-${OS}_${ARCH}" &&
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" &&
tar zxvf "${KREW}.tar.gz" &&
./"${KREW}" install krew
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
kubectl krew install hlf
if [ -f "~/.bashrc" ]; then
echo 'export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
fi
if [ -f "~/.zshrc" ]; then
echo 'export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc
fi
helm repo add kfs "https://kfsoftware.github.io/hlf-helm-charts" --force-update
helm install hlf-operator --version=1.8.0 kfs/hlf-operator
- name: Build Fablo
run: |
shellcheck --version && \
yamllint -v && \
npm install && \
npm run build && \
./fablo-build.sh
- name: fablo k8 tests
run: |
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
e2e-network/k8s/test-01-simple-k8s.sh
test-02-raft:
needs: test-main
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Build Fablo
run: |
shellcheck --version && \
yamllint -v && \
npm install && \
./fablo-build.sh
- name: Test RAFT network
run: e2e-network/docker/test-02-raft-2orgs.sh
- uses: actions/upload-artifact@v2
if: always()
with:
name: test-02-raft
path: |
e2e-network/docker/test-02-raft.sh.logs/*
e2e-network/docker/test-02-raft.sh.tmpdir/fablo-target/**/*
test-03-private-data:
needs: test-main
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Build Fablo
run: |
shellcheck --version && \
yamllint -v && \
npm install && \
./fablo-build.sh
- name: Test private data
run: e2e-network/docker/test-03-private-data.sh
- uses: actions/upload-artifact@v2
if: always()
with:
name: test-03-private-data
path: |
e2e-network/docker/test-03-private-data.sh.logs/*
e2e-network/docker/test-03-private-data.sh.tmpdir/fablo-target/**/*
test-04-snapshot:
needs: test-main
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Build Fablo
run: |
shellcheck --version && \
yamllint -v && \
npm install && \
./fablo-build.sh
- name: Test snapshots
run: e2e-network/docker/test-04-snapshot.sh
- uses: actions/upload-artifact@v2
if: always()
with:
name: test-04-snapshot
path: |
e2e-network/docker/test-04-snapshot.sh.logs/*
e2e-network/docker/test-04-snapshot.sh.tmpdir/fablo-target/**/*