<commit_before>name: Acceptance Tests (GKE)

on:
  workflow_dispatch:
    inputs:
      region:
        description: The GKE region
        default: us-east1
      zone:
        description: The GKE zone
        default: us-east1-b
      kubernetesVersion:
        description: The GKE kubernetes version
        default: 1.23
      workersCount:
        description: The number of cluster nodes to provision
        default: 2
      nodeMachineType:
        description: The type of GKE instance to use for cluster nodes
        default: e2-standard-2
      runTests:
        description: The regex passed to the -run option of `go test`
        default: ".*"
      terraformVersion:
        description: Terraform version
        default: 1.2.4

env:
  GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
  GOOGLE_PROJECT: ${{ secrets.GOOGLE_PROJECT }}
  GOOGLE_REGION: ${{ github.event.inputs.region }}
  GOOGLE_ZONE: ${{github.event.inputs.zone}}

jobs:
  acceptance_tests:
    permissions:
      contents: 'read'
      id-token: 'write'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Read go-version
        id: go-version
        uses: juliangruber/read-file-action@v1
        with:
          path: ./.go-version
      - name: Set up Go
        uses: actions/setup-go@v2
        with:
          go-version: ${{ steps.go-version.outputs.content }}
      - name: Authenticate to Google Cloud
        uses: "google-github-actions/auth@v0"
        with:
          credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}
          access_token_lifetime: '10800s'
      - name: Install Terraform
        uses: hashicorp/setup-terraform@v1
        with:
          terraform_version: ${{ github.event.inputs.terraformVersion }}
      - name: "Set up Cloud SDK"
        uses: "google-github-actions/setup-gcloud@v0"
      - name: "Initialize gcloud SDK"
        run: "gcloud init"
      - name: Provision GKE Cluster
        working-directory: ./kubernetes/test-infra/gke
        env:
          TF_VAR_kubernetes_version: ${{ github.event.inputs.kubernetesVersion }}
          TF_VAR_workers_count: ${{ github.event.inputs.workersCount }}
          TF_VAR_node_machine_type: ${{ github.event.inputs.nodeMachineType }}
        run: |
          env
          terraform init
          terraform apply -auto-approve
          echo "GOOGLE_CLUSTER_NAME=`terraform output -raw cluster_name`" >> $GITHUB_ENV

      - name: Get GKE Credentials<commit_msg>Set GKE test tf wrapper to false (#1778)<commit_after>name: Acceptance Tests (GKE)

on:
  workflow_dispatch:
    inputs:
      region:
        description: The GKE region
        default: us-east1
      zone:
        description: The GKE zone
        default: us-east1-b
      kubernetesVersion:
        description: The GKE kubernetes version
        default: 1.23
      workersCount:
        description: The number of cluster nodes to provision
        default: 2
      nodeMachineType:
        description: The type of GKE instance to use for cluster nodes
        default: e2-standard-2
      runTests:
        description: The regex passed to the -run option of `go test`
        default: ".*"
      terraformVersion:
        description: Terraform version
        default: 1.2.4

env:
  GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
  GOOGLE_PROJECT: ${{ secrets.GOOGLE_PROJECT }}
  GOOGLE_REGION: ${{ github.event.inputs.region }}
  GOOGLE_ZONE: ${{github.event.inputs.zone}}

jobs:
  acceptance_tests:
    permissions:
      contents: 'read'
      id-token: 'write'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Read go-version
        id: go-version
        uses: juliangruber/read-file-action@v1
        with:
          path: ./.go-version
      - name: Set up Go
        uses: actions/setup-go@v2
        with:
          go-version: ${{ steps.go-version.outputs.content }}
      - name: Authenticate to Google Cloud
        uses: "google-github-actions/auth@v0"
        with:
          credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}
          access_token_lifetime: '10800s'
      - name: Install Terraform
        uses: hashicorp/setup-terraform@v1
        with:
          terraform_version: ${{ github.event.inputs.terraformVersion }}
          terraform_wrapper: false
      - name: "Set up Cloud SDK"
        uses: "google-github-actions/setup-gcloud@v0"
      - name: "Initialize gcloud SDK"
        run: "gcloud init"
      - name: Provision GKE Cluster
        working-directory: ./kubernetes/test-infra/gke
        env:
          TF_VAR_kubernetes_version: ${{ github.event.inputs.kubernetesVersion }}
          TF_VAR_workers_count: ${{ github.event.inputs.workersCount }}
          TF_VAR_node_machine_type: ${{ github.event.inputs.nodeMachineType }}
        run: |
          env
          terraform init
          terraform apply -auto-approve
          echo "GOOGLE_CLUSTER_NAME=`terraform output -raw cluster_name`" >> $GITHUB_ENV
      - name: Get GKE Credentials
{'fraction_non_alphanumeric': 0.09516225363328688, 'fraction_numerical': 0.009556042205853077, 'mean_word_length': 2.2308681672025723, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1073212', 'n_tokens_mistral': 1570, 'n_tokens_neox': 1507, 'n_words': 362}