Move FAST tests to main tests workflow

This commit is contained in:
Julio Castillo 2022-04-12 21:03:20 +02:00
parent cde0b5d051
commit 0ea0fa622b
2 changed files with 39 additions and 61 deletions

View File

@ -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

View File

@ -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