From 0ea0fa622bb6762b2e80689cbfbb8dd8dfd1442c Mon Sep 17 00:00:00 2001 From: Julio Castillo Date: Tue, 12 Apr 2022 21:03:20 +0200 Subject: [PATCH] Move FAST tests to main tests workflow --- .github/workflows/fast-tests.yml | 55 -------------------------------- .github/workflows/tests.yml | 45 ++++++++++++++++++++++---- 2 files changed, 39 insertions(+), 61 deletions(-) delete mode 100644 .github/workflows/fast-tests.yml diff --git a/.github/workflows/fast-tests.yml b/.github/workflows/fast-tests.yml deleted file mode 100644 index f8524766..00000000 --- a/.github/workflows/fast-tests.yml +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: "FAST Tests" -on: - pull_request: - branches: - - fast-dev - - fast-dev-gke - - master - # paths: - # - 'modules/**' - # - 'fast/stages/**' - # - 'tests/fast/**' - tags: - - ci - - test - -env: - TF_PLUGIN_CACHE_DIR: "/home/runner/.terraform.d/plugin-cache" - GOOGLE_APPLICATION_CREDENTIALS: "/home/runner/credentials.json" - PYTEST_ADDOPTS: "--color=yes" - -jobs: - all-fast-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Config auth - run: | - echo '{"type": "service_account", "project_id": "test-only"}' \ - | tee -a $GOOGLE_APPLICATION_CREDENTIALS - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.9" - - - name: Run tests on FAST stages - run: | - mkdir -p ${{ env.TF_PLUGIN_CACHE_DIR }} - pip install -r tests/requirements.txt - pytest -vv tests/fast diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5375865f..9057b9f3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,9 +26,11 @@ on: - test env: - TF_PLUGIN_CACHE_DIR: "/home/runner/.terraform.d/plugin-cache" GOOGLE_APPLICATION_CREDENTIALS: "/home/runner/credentials.json" PYTEST_ADDOPTS: "--color=yes" + PYTHON_VERSION: 3.9 + TF_PLUGIN_CACHE_DIR: "/home/runner/.terraform.d/plugin-cache" + TF_VERSION: 1.1.8 jobs: doc-examples: @@ -44,9 +46,10 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: "3.9" + python-version: ${{ env.PYTHON_VERSION }} - name: Run tests on documentation examples + id: pytest run: | mkdir -p ${{ env.TF_PLUGIN_CACHE_DIR }} pip install -r tests/requirements.txt @@ -65,15 +68,16 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: "3.9" + python-version: ${{ env.PYTHON_VERSION }} - name: Set up Terraform uses: hashicorp/setup-terraform@v1 with: - terraform_version: 1.1.4 + terraform_version: ${{ env.TF_VERSION }} terraform_wrapper: false - name: Run tests environments + id: pytest run: | mkdir -p ${{ env.TF_PLUGIN_CACHE_DIR }} pip install -r tests/requirements.txt @@ -92,16 +96,45 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: "3.9" + python-version: ${{ env.PYTHON_VERSION }} - name: Set up Terraform uses: hashicorp/setup-terraform@v1 with: - terraform_version: 1.1.4 + terraform_version: ${{ env.TF_VERSION }} terraform_wrapper: false - name: Run tests modules + id: pytest run: | mkdir -p ${{ env.TF_PLUGIN_CACHE_DIR }} pip install -r tests/requirements.txt pytest -vv tests/modules + + fast: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Config auth + run: | + echo '{"type": "service_account", "project_id": "test-only"}' \ + | tee -a $GOOGLE_APPLICATION_CREDENTIALS + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v1 + with: + terraform_version: ${{ env.TF_VERSION }} + terraform_wrapper: false + + - name: Run tests on FAST stages + id: pytest + run: | + mkdir -p ${{ env.TF_PLUGIN_CACHE_DIR }} + pip install -r tests/requirements.txt + pytest -vv tests/fast