Skip to content

chore: Remove un-used function #1422

chore: Remove un-used function

chore: Remove un-used function #1422

Workflow file for this run

# Terraform Provider testing workflow.
name: Tests
# This GitHub action runs your tests for each pull request and push.
# Optionally, you can turn it on using a schedule for regular testing.
on:
push:
branches: [ main ]
paths-ignore:
- 'README.md'
- '.gitignore'
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
paths-ignore:
- 'README.md'
- '.gitignore'
# Testing only needs permissions to read the repository contents.
permissions:
contents: read
# Default values to simplify job configurations below.
env:
# Go language version to use for building. This value should also be updated
# in the release workflow if changed.
GO_VERSION: 1.19
TASK_VERSION: 3.x
jobs:
# Setup matrix for current branch.
# If we are on main, run tests with all terraform version
# Otherwise, run tests only on latest
matrix_prep:
name: Prepare Test Matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Check out source code
uses: actions/checkout@v3
- name: Branch name
uses: nelonoel/branch-name@v1.0.1
- name: Conditional build matrix
id: set-matrix
uses: JoshuaTheMiller/conditional-build-matrix@v1.0.1
with:
# The simple branch name can be used in the filter now!
filter: '[?runOnBranch==`${{ env.BRANCH_NAME }}` || runOnBranch==`always`]'
# Ensure project builds before running testing matrix
build:
name: Build Terraform Provider
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Set up Task
uses: arduino/setup-task@v1
with:
version: ${{ env.TASK_VERSION }}
- name: Check out source code
uses: actions/checkout@v3
- name: Build
run: task build
lint:
name: Lint Terraform Provider
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Set up Task
uses: arduino/setup-task@v1
with:
version: ${{ env.TASK_VERSION }}
- name: Check out source code
uses: actions/checkout@v3
- name: Lint
run: task lint
generate:
name: Generate Documentation
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Set up Task
uses: arduino/setup-task@v1
with:
version: ${{ env.TASK_VERSION }}
- name: Check out source code
uses: actions/checkout@v3
- name: Generate documentation
env:
QOVERY_API_TOKEN: ${{ secrets.QOVERY_API_TOKEN }}
run: task docs
- name: Check git diff
run: |
git diff --compact-summary --exit-code || \
(echo; echo "Unexpected difference in directories after code generation. Run 'task docs' command and commit."; exit 1)
mocks:
name: Generate Mocks
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Set up Task
uses: arduino/setup-task@v1
with:
version: ${{ env.TASK_VERSION }}
- name: Check out source code
uses: actions/checkout@v3
- name: Generate mocks
run: task mocks
- name: Check git diff
run: |
git diff --compact-summary --exit-code || \
(echo; echo "Unexpected difference in directories after code generation. Run 'task mocks' command and commit."; exit 1)
# Run acceptance tests in a matrix with Terraform CLI versions
test:
name: Terraform Provider Acceptance Tests
needs:
- matrix_prep
- build
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: true
matrix: ${{fromJson(needs.matrix_prep.outputs.matrix)}}
max-parallel: 1
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Set up Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: ${{ matrix.terraform }}
terraform_wrapper: false
- name: Set up Task
uses: arduino/setup-task@v1
with:
version: ${{ env.TASK_VERSION }}
- name: Check out source code
uses: actions/checkout@v3
- name: Run acceptance tests
timeout-minutes: 120
env:
TF_ACC: "1"
QOVERY_API_TOKEN: ${{ secrets.QOVERY_API_TOKEN }}
TEST_ORGANIZATION_ID: ${{ secrets.TEST_ORGANIZATION_ID }}
TEST_AWS_CREDENTIALS_ID: ${{ secrets.TEST_AWS_CREDENTIALS_ID }}
TEST_AWS_CREDENTIALS_ACCESS_KEY_ID: ${{ secrets.TEST_AWS_CREDENTIALS_ACCESS_KEY_ID }}
TEST_AWS_CREDENTIALS_SECRET_ACCESS_KEY: ${{ secrets.TEST_AWS_CREDENTIALS_SECRET_ACCESS_KEY }}
TEST_SCALEWAY_CREDENTIALS_ID: ${{ secrets.TEST_SCALEWAY_CREDENTIALS_ID }}
TEST_SCALEWAY_CREDENTIALS_PROJECT_ID: ${{ secrets.TEST_SCALEWAY_CREDENTIALS_PROJECT_ID }}
TEST_SCALEWAY_CREDENTIALS_ORGANIZATION_ID: ${{ secrets.TEST_SCALEWAY_CREDENTIALS_ORGANIZATION_ID }}
TEST_SCALEWAY_CREDENTIALS_ACCESS_KEY: ${{ secrets.TEST_SCALEWAY_CREDENTIALS_ACCESS_KEY }}
TEST_SCALEWAY_CREDENTIALS_SECRET_KEY: ${{ secrets.TEST_SCALEWAY_CREDENTIALS_SECRET_KEY }}
TEST_CLUSTER_ID: ${{ secrets.TEST_CLUSTER_ID }}
TEST_PROJECT_ID: ${{ secrets.TEST_PROJECT_ID }}
TEST_ENVIRONMENT_ID: ${{ secrets.TEST_ENVIRONMENT_ID }}
TEST_APPLICATION_ID: ${{ secrets.TEST_APPLICATION_ID }}
TEST_DATABASE_ID: ${{ secrets.TEST_DATABASE_ID }}
TEST_CONTAINER_REGISTRY_ID: ${{ secrets.TEST_CONTAINER_REGISTRY_ID }}
TEST_CONTAINER_ID: ${{ secrets.TEST_CONTAINER_ID }}
TEST_JOB_ID: ${{ secrets.TEST_JOB_ID }}
TEST_HELM_ID: ${{ secrets.TEST_HELM_ID }}
TEST_HELM_REPOSITORY_ID: ${{ secrets.TEST_HELM_REPOSITORY_ID }}
TEST_AWS_ECR_URL: ${{ secrets.TEST_AWS_ECR_URL }}
TEST_QOVERY_HOST: ${{ secrets.TEST_QOVERY_HOST }}
TEST_QOVERY_SANDBOX_GIT_TOKEN_ID: ${{ secrets.TEST_QOVERY_SANDBOX_GIT_TOKEN_ID }}
TEST_ANNOTATIONS_GROUP_ID: ${{ secrets.TEST_ANNOTATIONS_GROUP_ID }}
TEST_LABELS_GROUP_ID: ${{ secrets.TEST_LABELS_GROUP_ID }}
run: task testacc