-
Notifications
You must be signed in to change notification settings - Fork 6
67 lines (66 loc) · 2.68 KB
/
terratest.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
name: Intgeration tests
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
push:
tags:
- "v*"
jobs:
go-tests:
name: Run Go Tests
runs-on: ubuntu-latest
timeout-minutes: 0
strategy:
fail-fast: false
matrix:
network: ["dev", "qa", "test", "main"]
include:
- describe: "git describe --match 'v[0-9]*.[0-9]*.[0-9]*-*' --exclude='*-rc*' --exclude='*-qa*' --abbrev=0 HEAD"
network: "dev"
- describe: "git describe --match 'v[0-9]*.[0-9]*.[0-9]*-*' --exclude='*-rc*' --exclude='*-dev*' --abbrev=0 HEAD"
network: "qa"
- describe: "git describe --match 'v[0-9]*.[0-9]*.[0-9]*-*' --exclude='*-dev*' --exclude='*-qa*' --abbrev=0 HEAD"
network: "test"
- describe: "git describe v1.8.2"
network: "main"
steps:
- uses: actions/setup-go@v4
with:
go-version: 1.21
- uses: autero1/action-terraform@v1.1.1
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
with:
terraform_version: 1.0.11
- name: install wg and yggdrasil and add peers
run: |
sudo apt-get update
sudo apt-get install -y wireguard
sudo apt-get install dirmngr
sudo apt-get install curl
gpg --fetch-keys https://neilalexander.s3.dualstack.eu-west-2.amazonaws.com/deb/key.txt
gpg --export 569130E8CA20FBC4CB3FDE555898470A764B32C9 | sudo apt-key add -
echo 'deb http://neilalexander.s3.dualstack.eu-west-2.amazonaws.com/deb/ debian yggdrasil' | sudo tee /etc/apt/sources.list.d/yggdrasil.list
sudo apt-get update
sudo apt-get install yggdrasil
sudo systemctl enable yggdrasil
PEERS=$(curl https://raw.githubusercontent.com/threefoldtech/zos-config/main/development.json | jq '.yggdrasil.peers[]' -r | sed 's/\//\\\//g' | sed -z 's/\n/\\n/g')
sudo sed -i -- 's/Peers\: \[\]/Peers: [\n'"$PEERS"']/g' /etc/yggdrasil/yggdrasil.conf
sudo systemctl start yggdrasil
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
- run: git checkout $(${{ matrix.describe }})
- name: Build
run: |
go mod tidy
mkdir -p ~/.terraform.d/plugins/threefoldtechdev.com/providers/grid/0.2/linux_amd64/
go build -o terraform-provider-grid
mv terraform-provider-grid ~/.terraform.d/plugins/threefoldtechdev.com/providers/grid/0.2/linux_amd64/
- name: Run Go Tests
env:
MNEMONICS: ${{ secrets.MNEMONICS }}
NETWORK: ${{ matrix.network }}
working-directory: integrationtests
run: go test -v ./... --tags=integration -timeout 1800s