Test suite #258
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test suite | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: "branch on which to run tests: master, release/v5" | |
required: true | |
type: string | |
default: "master" | |
test-tags: | |
description: "test tags, in the form of a list without spaces: 'all,compute,k8s,dbaas,mariadb,mongo,psql,natgateway,nlb,alb,server,firewall,dns,logging etc.' " | |
required: false | |
type: string | |
default: "compute" | |
tf-log: | |
description: "terraform logs, accepted values: OFF, TRACE, DEBUG, INFO, WARN or ERROR" | |
required: false | |
type: string | |
default: "ERROR" | |
fail-fast: | |
description: "toggles the '-failfast' flag for the go test command" | |
required: false | |
type: boolean | |
default: true | |
jobs: | |
test: | |
env: | |
IONOS_USERNAME: ${{ secrets.IONOS_VDC_USER_GO_V6 }} | |
IONOS_PASSWORD: ${{ secrets.IONOS_VDC_PASSWORD_GO_V6 }} | |
IONOS_TOKEN: ${{ secrets.IONOS_VDC_TOKEN_GO_V6 }} | |
IONOS_S3_ACCESS_KEY: ${{ secrets.IONOS_VDC_S3_ACCESS_KEY_GO_V6 }} | |
IONOS_S3_SECRET_KEY: ${{ secrets.IONOS_VDC_S3_SECRET_KEY_GO_V6 }} | |
TF_ACC: true | |
TF_LOG: ${{ github.event.inputs.tf-log }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.inputs.branch }} | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
- name: Run tests for ${{ github.event.inputs.test-tags }} | |
if: ${{ github.event.inputs.test-tags != '' && github.events.inputs.failfast == true }} | |
run: go test ./... -v -failfast -timeout 240m -tags ${{ github.event.inputs.test-tags }} | |
- name: Run tests for ${{ github.event.inputs.test-tags }} no failfast | |
if: ${{ github.event.inputs.test-tags != '' && github.events.inputs.failfast == false }} | |
run: go test ./... -v -timeout 6h -tags ${{ github.event.inputs.test-tags }} | |
- name: Run tests without tags | |
if: ${{ github.event.inputs.test-tags == ''}} | |
run: go test ./... -v -failfast -timeout 180m |