Skip to content

Commit

Permalink
split tests in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rawdaGastan committed Aug 11, 2024
1 parent 35f7991 commit 9fa9413
Showing 1 changed file with 38 additions and 83 deletions.
121 changes: 38 additions & 83 deletions .github/workflows/terratest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -50,89 +48,46 @@ 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
runs-on: ubuntu-latest
timeout-minutes: 0
strategy:
fail-fast: false
max-parallel: 1
matrix:
network: ["dev", "qa", "test", "main"]
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
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.21
- uses: autero1/[email protected]
env:
MNEMONIC: ${{ secrets.MNEMONICS }}
NETWORK: ${{ matrix.network }}
working-directory: integrationtests
run: go test -v ./... --tags=integration -run TestMattermost

- name: Test nomad
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
with:
terraform-version: 1.8.5
- uses: actions/[email protected]
with:
fetch-depth: 0
- 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 }}

0 comments on commit 9fa9413

Please sign in to comment.