@@ -2,21 +2,35 @@ name: Intgeration tests
22
33on :
44 schedule :
5- - cron : " 0 0 * * *"
5+ - cron : " 0 1 * * *"
66 workflow_dispatch :
77 push :
88 tags :
99 - " v*"
1010
1111jobs :
12- go-tests :
13- name : Run Go Tests
12+ test-dev :
13+ name : Testing
1414 runs-on : ubuntu-latest
1515 timeout-minutes : 0
1616 strategy :
1717 fail-fast : false
18+ max-parallel : 1
1819 matrix :
19- network : ["dev", "qa", "test", "main"]
20+ # network: ["dev", "qa", "test", "main"]
21+ network : ["dev"]
22+ tests : [{name: "vm", test: "go test -v ./... --tags=integration -run TestVM"},
23+ {name: "k8s", test: "go test -v ./... --tags=integration -run TestK8s"},
24+ {name: "gateway", test: "go test -v ./... --tags=integration -run TestGatewayDeployments"},
25+ {name: "gateway-private", test: "go test -v ./... --tags=integration -run TestGatewayPrivate"},
26+ {name: "wireguard", test: "go test -v ./... --tags=integration -run TestWireguard"},
27+ {name: "zdb", test: "go test -v ./... --tags=integration -run TestZdbs"},
28+ {name: "qsfs", test: "go test -v ./... --tags=integration -run TestQSFS"},
29+ {name: "peertube", test: "go test -v ./... --tags=integration -run TestPeertube"},
30+ {name: "presearch", test: "go test -v ./... --tags=integration -run TestPresearch"},
31+ {name: "taiga", test: "go test -v ./... --tags=integration -run TestTaiga"},
32+ {name: "mattermost", test: "go test -v ./... --tags=integration -run TestMattermost"}]
33+
2034 steps :
2135 - uses : actions/setup-go@v5
2236 with :
4155 PEERS=$(curl https://raw.githubusercontent.com/AhmedHanafy725/yggdrasil-config/main/config.json | jq '.yggdrasil.peers[]' -r | sed 's/\//\\\//g' | sed -z 's/\n/\\n/g')
4256 sudo sed -i -- 's/Peers\: \[\]/Peers: [\n'"$PEERS"']/g' /etc/yggdrasil/yggdrasil.conf
4357 sudo systemctl restart yggdrasil
44- - uses : actions/checkout@v4.1.1
58+ - uses : actions/checkout@v4
4559 with :
4660 fetch-depth : 0
4761 - name : Build
@@ -50,89 +64,196 @@ jobs:
5064 mkdir -p ~/.terraform.d/plugins/threefoldtechdev.com/providers/grid/0.2/linux_amd64/
5165 go build -o terraform-provider-grid
5266 mv terraform-provider-grid ~/.terraform.d/plugins/threefoldtechdev.com/providers/grid/0.2/linux_amd64/
53- - name : Test virtual machines
67+ - name : Test ${{ matrix.tests.name }}
5468 env :
5569 MNEMONIC : ${{ secrets.MNEMONICS }}
70+ MNEMONICS : ${{ secrets.MNEMONICS }}
5671 NETWORK : ${{ matrix.network }}
5772 working-directory : integrationtests
58- run : go test -v ./... --tags=integration -run TestVM
73+ run : ${{ matrix.tests.test }}
74+
75+ test-qa :
76+ name : Testing
77+ runs-on : ubuntu-latest
78+ timeout-minutes : 0
79+ strategy :
80+ fail-fast : false
81+ max-parallel : 1
82+ matrix :
83+ network : ["qa"]
84+ tests : [{name: "vm", test: "go test -v ./... --tags=integration -run TestVM"},
85+ {name: "k8s", test: "go test -v ./... --tags=integration -run TestK8s"},
86+ {name: "gateway", test: "go test -v ./... --tags=integration -run TestGatewayDeployments"},
87+ {name: "gateway-private", test: "go test -v ./... --tags=integration -run TestGatewayPrivate"},
88+ {name: "wireguard", test: "go test -v ./... --tags=integration -run TestWireguard"},
89+ {name: "zdb", test: "go test -v ./... --tags=integration -run TestZdbs"},
90+ {name: "qsfs", test: "go test -v ./... --tags=integration -run TestQSFS"},
91+ {name: "peertube", test: "go test -v ./... --tags=integration -run TestPeertube"},
92+ {name: "presearch", test: "go test -v ./... --tags=integration -run TestPresearch"},
93+ {name: "taiga", test: "go test -v ./... --tags=integration -run TestTaiga"},
94+ {name: "mattermost", test: "go test -v ./... --tags=integration -run TestMattermost"}]
5995
60- - name : Test kubernetes
96+ steps :
97+ - uses : actions/setup-go@v5
98+ with :
99+ go-version : 1.21
100+ - uses : autero1/action-terraform@v3.0.1
61101 env :
62- MNEMONIC : ${{ secrets.MNEMONICS }}
63- NETWORK : ${{ matrix.network }}
64- working-directory : integrationtests
102+ ACTIONS_ALLOW_UNSECURE_COMMANDS : true
103+ with :
104+ terraform-version : 1.8.5
105+ - name : install wg and yggdrasil and add peers
65106 run : |
66- go test -v ./... --tags=integration -run TestK8s
67- go test -v ./... --tags=integration -run TestModuleK8s
68-
69- - name : Test Gateways
70- env :
71- MNEMONIC : ${{ secrets.MNEMONICS }}
72- NETWORK : ${{ matrix.network }}
73- working-directory : integrationtests
74- run : go test -v ./... --tags=integration -run TestGatewayDeployments
75-
76- - name : Test private gateways
77- env :
78- MNEMONIC : ${{ secrets.MNEMONICS }}
79- NETWORK : ${{ matrix.network }}
80- working-directory : integrationtests
81- run : go test -v ./... --tags=integration -run TestGatewayPrivate
82-
83- - name : Test wireguard
84- env :
85- MNEMONIC : ${{ secrets.MNEMONICS }}
86- NETWORK : ${{ matrix.network }}
87- working-directory : integrationtests
88- run : go test -v ./... --tags=integration -run TestWireguard
89-
90- - name : Test ZDBs
91- env :
92- MNEMONIC : ${{ secrets.MNEMONICS }}
93- NETWORK : ${{ matrix.network }}
94- working-directory : integrationtests
95- run : go test -v ./... --tags=integration -run TestZdbs
96-
97- - name : Test QSFS
98- env :
99- MNEMONIC : ${{ secrets.MNEMONICS }}
100- NETWORK : ${{ matrix.network }}
101- working-directory : integrationtests
102- run : go test -v ./... --tags=integration -run TestQSFS
103-
104- - name : Test peertube
107+ sudo apt-get update
108+ sudo apt-get install -y wireguard
109+ sudo apt-get install dirmngr
110+ sudo apt-get install curl
111+ gpg --fetch-keys https://neilalexander.s3.dualstack.eu-west-2.amazonaws.com/deb/key.txt
112+ gpg --export 569130E8CA20FBC4CB3FDE555898470A764B32C9 | sudo apt-key add -
113+ echo 'deb http://neilalexander.s3.dualstack.eu-west-2.amazonaws.com/deb/ debian yggdrasil' | sudo tee /etc/apt/sources.list.d/yggdrasil.list
114+ sudo apt-get update
115+ sudo apt-get install yggdrasil
116+ sudo systemctl enable yggdrasil
117+ PEERS=$(curl https://raw.githubusercontent.com/AhmedHanafy725/yggdrasil-config/main/config.json | jq '.yggdrasil.peers[]' -r | sed 's/\//\\\//g' | sed -z 's/\n/\\n/g')
118+ sudo sed -i -- 's/Peers\: \[\]/Peers: [\n'"$PEERS"']/g' /etc/yggdrasil/yggdrasil.conf
119+ sudo systemctl restart yggdrasil
120+ - uses : actions/checkout@v4
121+ with :
122+ fetch-depth : 0
123+ - name : Build
124+ run : |
125+ go mod tidy
126+ mkdir -p ~/.terraform.d/plugins/threefoldtechdev.com/providers/grid/0.2/linux_amd64/
127+ go build -o terraform-provider-grid
128+ mv terraform-provider-grid ~/.terraform.d/plugins/threefoldtechdev.com/providers/grid/0.2/linux_amd64/
129+ - name : Test ${{ matrix.tests.name }}
105130 env :
106131 MNEMONIC : ${{ secrets.MNEMONICS }}
132+ MNEMONICS : ${{ secrets.MNEMONICS }}
107133 NETWORK : ${{ matrix.network }}
108134 working-directory : integrationtests
109- run : go test -v ./... --tags=integration -run TestPeertube
135+ run : ${{ matrix.tests.test }}
136+
137+ test-test :
138+ name : Testing
139+ runs-on : ubuntu-latest
140+ timeout-minutes : 0
141+ strategy :
142+ fail-fast : false
143+ max-parallel : 1
144+ matrix :
145+ network : ["test"]
146+ tests : [{name: "vm", test: "go test -v ./... --tags=integration -run TestVM"},
147+ {name: "k8s", test: "go test -v ./... --tags=integration -run TestK8s"},
148+ {name: "gateway", test: "go test -v ./... --tags=integration -run TestGatewayDeployments"},
149+ {name: "gateway-private", test: "go test -v ./... --tags=integration -run TestGatewayPrivate"},
150+ {name: "wireguard", test: "go test -v ./... --tags=integration -run TestWireguard"},
151+ {name: "zdb", test: "go test -v ./... --tags=integration -run TestZdbs"},
152+ {name: "qsfs", test: "go test -v ./... --tags=integration -run TestQSFS"},
153+ {name: "peertube", test: "go test -v ./... --tags=integration -run TestPeertube"},
154+ {name: "presearch", test: "go test -v ./... --tags=integration -run TestPresearch"},
155+ {name: "taiga", test: "go test -v ./... --tags=integration -run TestTaiga"},
156+ {name: "mattermost", test: "go test -v ./... --tags=integration -run TestMattermost"}]
110157
111- - name : Test presearch
158+ steps :
159+ - uses : actions/setup-go@v5
160+ with :
161+ go-version : 1.21
162+ - uses : autero1/action-terraform@v3.0.1
112163 env :
113- MNEMONIC : ${{ secrets.MNEMONICS }}
114- NETWORK : ${{ matrix.network }}
115- working-directory : integrationtests
116- run : go test -v ./... --tags=integration -run TestPresearch
117-
118- - name : Test taiga
164+ ACTIONS_ALLOW_UNSECURE_COMMANDS : true
165+ with :
166+ terraform-version : 1.8.5
167+ - name : install wg and yggdrasil and add peers
168+ run : |
169+ sudo apt-get update
170+ sudo apt-get install -y wireguard
171+ sudo apt-get install dirmngr
172+ sudo apt-get install curl
173+ gpg --fetch-keys https://neilalexander.s3.dualstack.eu-west-2.amazonaws.com/deb/key.txt
174+ gpg --export 569130E8CA20FBC4CB3FDE555898470A764B32C9 | sudo apt-key add -
175+ echo 'deb http://neilalexander.s3.dualstack.eu-west-2.amazonaws.com/deb/ debian yggdrasil' | sudo tee /etc/apt/sources.list.d/yggdrasil.list
176+ sudo apt-get update
177+ sudo apt-get install yggdrasil
178+ sudo systemctl enable yggdrasil
179+ PEERS=$(curl https://raw.githubusercontent.com/AhmedHanafy725/yggdrasil-config/main/config.json | jq '.yggdrasil.peers[]' -r | sed 's/\//\\\//g' | sed -z 's/\n/\\n/g')
180+ sudo sed -i -- 's/Peers\: \[\]/Peers: [\n'"$PEERS"']/g' /etc/yggdrasil/yggdrasil.conf
181+ sudo systemctl restart yggdrasil
182+ - uses : actions/checkout@v4
183+ with :
184+ fetch-depth : 0
185+ - name : Build
186+ run : |
187+ go mod tidy
188+ mkdir -p ~/.terraform.d/plugins/threefoldtechdev.com/providers/grid/0.2/linux_amd64/
189+ go build -o terraform-provider-grid
190+ mv terraform-provider-grid ~/.terraform.d/plugins/threefoldtechdev.com/providers/grid/0.2/linux_amd64/
191+ - name : Test ${{ matrix.tests.name }}
119192 env :
120193 MNEMONIC : ${{ secrets.MNEMONICS }}
194+ MNEMONICS : ${{ secrets.MNEMONICS }}
121195 NETWORK : ${{ matrix.network }}
122196 working-directory : integrationtests
123- run : go test -v ./... --tags=integration -run TestTaiga
197+ run : ${{ matrix.tests.test }}
198+
199+ test-main :
200+ name : Testing
201+ runs-on : ubuntu-latest
202+ timeout-minutes : 0
203+ strategy :
204+ fail-fast : false
205+ max-parallel : 1
206+ matrix :
207+ network : ["main"]
208+ tests : [{name: "vm", test: "go test -v ./... --tags=integration -run TestVM"},
209+ {name: "k8s", test: "go test -v ./... --tags=integration -run TestK8s"},
210+ {name: "gateway", test: "go test -v ./... --tags=integration -run TestGatewayDeployments"},
211+ {name: "gateway-private", test: "go test -v ./... --tags=integration -run TestGatewayPrivate"},
212+ {name: "wireguard", test: "go test -v ./... --tags=integration -run TestWireguard"},
213+ {name: "zdb", test: "go test -v ./... --tags=integration -run TestZdbs"},
214+ {name: "qsfs", test: "go test -v ./... --tags=integration -run TestQSFS"},
215+ {name: "peertube", test: "go test -v ./... --tags=integration -run TestPeertube"},
216+ {name: "presearch", test: "go test -v ./... --tags=integration -run TestPresearch"},
217+ {name: "taiga", test: "go test -v ./... --tags=integration -run TestTaiga"},
218+ {name: "mattermost", test: "go test -v ./... --tags=integration -run TestMattermost"}]
124219
125- - name : Test mattermost
220+ steps :
221+ - uses : actions/setup-go@v5
222+ with :
223+ go-version : 1.21
224+ - uses : autero1/action-terraform@v3.0.1
126225 env :
127- MNEMONIC : ${{ secrets.MNEMONICS }}
128- NETWORK : ${{ matrix.network }}
129- working-directory : integrationtests
130- run : go test -v ./... --tags=integration -run TestMattermost
131-
132- - name : Test nomad
226+ ACTIONS_ALLOW_UNSECURE_COMMANDS : true
227+ with :
228+ terraform-version : 1.8.5
229+ - name : install wg and yggdrasil and add peers
230+ run : |
231+ sudo apt-get update
232+ sudo apt-get install -y wireguard
233+ sudo apt-get install dirmngr
234+ sudo apt-get install curl
235+ gpg --fetch-keys https://neilalexander.s3.dualstack.eu-west-2.amazonaws.com/deb/key.txt
236+ gpg --export 569130E8CA20FBC4CB3FDE555898470A764B32C9 | sudo apt-key add -
237+ echo 'deb http://neilalexander.s3.dualstack.eu-west-2.amazonaws.com/deb/ debian yggdrasil' | sudo tee /etc/apt/sources.list.d/yggdrasil.list
238+ sudo apt-get update
239+ sudo apt-get install yggdrasil
240+ sudo systemctl enable yggdrasil
241+ PEERS=$(curl https://raw.githubusercontent.com/AhmedHanafy725/yggdrasil-config/main/config.json | jq '.yggdrasil.peers[]' -r | sed 's/\//\\\//g' | sed -z 's/\n/\\n/g')
242+ sudo sed -i -- 's/Peers\: \[\]/Peers: [\n'"$PEERS"']/g' /etc/yggdrasil/yggdrasil.conf
243+ sudo systemctl restart yggdrasil
244+ - uses : actions/checkout@v4
245+ with :
246+ fetch-depth : 0
247+ - name : Build
248+ run : |
249+ go mod tidy
250+ mkdir -p ~/.terraform.d/plugins/threefoldtechdev.com/providers/grid/0.2/linux_amd64/
251+ go build -o terraform-provider-grid
252+ mv terraform-provider-grid ~/.terraform.d/plugins/threefoldtechdev.com/providers/grid/0.2/linux_amd64/
253+ - name : Test ${{ matrix.tests.name }}
133254 env :
134255 MNEMONIC : ${{ secrets.MNEMONICS }}
256+ MNEMONICS : ${{ secrets.MNEMONICS }}
135257 NETWORK : ${{ matrix.network }}
136258 working-directory : integrationtests
137- run : go test -v ./... --tags=integration -run TestNomad
138-
259+ run : ${{ matrix.tests.test }}
0 commit comments