From 4ac0de3df8c998d5bb133128780ba7df45dd6807 Mon Sep 17 00:00:00 2001 From: rawdaGastan Date: Sun, 11 Aug 2024 14:33:39 +0300 Subject: [PATCH] split tests in workflow --- .github/workflows/terratest.yml | 117 +++++++++----------------------- 1 file changed, 33 insertions(+), 84 deletions(-) diff --git a/.github/workflows/terratest.yml b/.github/workflows/terratest.yml index 821bf071..6aa9c4fa 100644 --- a/.github/workflows/terratest.yml +++ b/.github/workflows/terratest.yml @@ -9,14 +9,12 @@ on: - "v*" jobs: - go-tests: - name: Run Go Tests + init: + name: Preparing runs-on: ubuntu-latest timeout-minutes: 0 strategy: fail-fast: false - matrix: - network: ["dev", "qa", "test", "main"] steps: - uses: actions/setup-go@v5 with: @@ -41,7 +39,7 @@ jobs: 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') sudo sed -i -- 's/Peers\: \[\]/Peers: [\n'"$PEERS"']/g' /etc/yggdrasil/yggdrasil.conf sudo systemctl restart yggdrasil - - uses: actions/checkout@v4.1.1 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Build @@ -50,89 +48,40 @@ jobs: 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: Test virtual machines - env: - MNEMONIC: ${{ secrets.MNEMONICS }} - NETWORK: ${{ matrix.network }} - working-directory: integrationtests - run: go test -v ./... --tags=integration -run TestVM - - - name: Test kubernetes - env: - MNEMONIC: ${{ secrets.MNEMONICS }} - NETWORK: ${{ matrix.network }} - working-directory: integrationtests - run: | - go test -v ./... --tags=integration -run TestK8s - go test -v ./... --tags=integration -run TestModuleK8s - - - name: Test Gateways - env: - MNEMONIC: ${{ secrets.MNEMONICS }} - NETWORK: ${{ matrix.network }} - working-directory: integrationtests - run: go test -v ./... --tags=integration -run TestGatewayDeployments - - name: Test private gateways - env: - MNEMONIC: ${{ secrets.MNEMONICS }} - NETWORK: ${{ matrix.network }} - working-directory: integrationtests - run: go test -v ./... --tags=integration -run TestGatewayPrivate - - - name: Test wireguard - env: - MNEMONIC: ${{ secrets.MNEMONICS }} - NETWORK: ${{ matrix.network }} - working-directory: integrationtests - run: go test -v ./... --tags=integration -run TestWireguard - - - name: Test ZDBs - env: - MNEMONIC: ${{ secrets.MNEMONICS }} - NETWORK: ${{ matrix.network }} - working-directory: integrationtests - run: go test -v ./... --tags=integration -run TestZdbs - - - name: Test QSFS - env: - MNEMONIC: ${{ secrets.MNEMONICS }} - NETWORK: ${{ matrix.network }} - working-directory: integrationtests - run: go test -v ./... --tags=integration -run TestQSFS - - - name: Test peertube - env: - MNEMONIC: ${{ secrets.MNEMONICS }} - NETWORK: ${{ matrix.network }} - working-directory: integrationtests - run: go test -v ./... --tags=integration -run TestPeertube - - - name: Test presearch - env: - MNEMONIC: ${{ secrets.MNEMONICS }} - NETWORK: ${{ matrix.network }} - working-directory: integrationtests - run: go test -v ./... --tags=integration -run TestPresearch - - - name: Test taiga - env: - MNEMONIC: ${{ secrets.MNEMONICS }} - NETWORK: ${{ matrix.network }} - working-directory: integrationtests - run: go test -v ./... --tags=integration -run TestTaiga + go-tests: + needs: init + name: Testing ${{ matrix.network }} ${{ matrix.tests.name }} + runs-on: ubuntu-latest + timeout-minutes: 0 + strategy: + fail-fast: false + max-parallel: 1 + matrix: + # network: ["dev", "qa", "test", "main"] + network: ["dev"] + tests: [{name: "vm", test: "go test -v ./... --tags=integration -run TestVM"}, + {name: "k8s", test: "go test -v ./... --tags=integration -run TestK8s"}, + {name: "k8s-module", test: "go test -v ./... --tags=integration -run TestModuleK8s"}, + {name: "gateway", test: "go test -v ./... --tags=integration -run TestGatewayDeployments"}, + {name: "gateway-private", test: "go test -v ./... --tags=integration -run TestGatewayPrivate"}, + {name: "wireguard", test: "go test -v ./... --tags=integration -run TestWireguard"}, + {name: "zdb", test: "go test -v ./... --tags=integration -run TestZdbs"}, + {name: "qsfs", test: "go test -v ./... --tags=integration -run TestQSFS"}, + {name: "peertube", test: "go test -v ./... --tags=integration -run TestPeertube"}, + {name: "presearch", test: "go test -v ./... --tags=integration -run TestPresearch"}, + {name: "taiga", test: "go test -v ./... --tags=integration -run TestTaiga"}, + {name: "mattermost", test: "go test -v ./... --tags=integration -run TestMattermost"}, + {name: "nomad", test: "go test -v ./... --tags=integration -run TestNomad"}] - - name: Test mattermost - env: - MNEMONIC: ${{ secrets.MNEMONICS }} - NETWORK: ${{ matrix.network }} - working-directory: integrationtests - run: go test -v ./... --tags=integration -run TestMattermost + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Test nomad + - name: Test ${{ matrix.tests.name }} env: MNEMONIC: ${{ secrets.MNEMONICS }} NETWORK: ${{ matrix.network }} working-directory: integrationtests - run: go test -v ./... --tags=integration -run TestNomad - + run: ${{ matrix.tests.test }}