cloud-foundation-fabric/.github/workflows/tests.yml

103 lines
2.8 KiB
YAML
Raw Normal View History

2023-02-25 04:08:30 -08:00
# Copyright 2023 Google LLC
2021-10-26 23:24:45 -07:00
#
# 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.
2022-01-01 06:52:31 -08:00
name: "Tests"
2021-10-27 07:08:29 -07:00
on:
# schedule:
# - cron: "45 2 * * *"
2021-10-26 23:24:45 -07:00
pull_request:
branches:
- master
tags:
- ci
- test
2021-10-26 23:28:10 -07:00
2021-10-27 07:08:29 -07:00
env:
GOOGLE_APPLICATION_CREDENTIALS: "/home/runner/credentials.json"
2021-10-27 07:08:29 -07:00
PYTEST_ADDOPTS: "--color=yes"
2022-08-31 06:28:15 -07:00
PYTHON_VERSION: "3.10"
2022-04-12 12:03:20 -07:00
TF_PLUGIN_CACHE_DIR: "/home/runner/.terraform.d/plugin-cache"
2023-02-25 04:08:30 -08:00
TF_VERSION: 1.3.9
2021-10-27 07:08:29 -07:00
2021-10-26 23:24:45 -07:00
jobs:
examples-blueprints:
2021-10-26 23:24:45 -07:00
runs-on: ubuntu-latest
steps:
2023-02-25 04:08:30 -08:00
- uses: actions/checkout@v3
2021-10-26 23:24:45 -07:00
- name: Call composite action fabric-tests
uses: ./.github/actions/fabric-tests
with:
PYTHON_VERSION: ${{ env.PYTHON_VERSION }}
TERRAFORM_VERSION: ${{ env.TERRAFORM_VERSION }}
- name: Run tests on documentation examples
2023-03-09 06:52:01 -08:00
run: pytest -vv -k blueprints/ tests/examples
examples-modules:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Call composite action fabric-tests
uses: ./.github/actions/fabric-tests
with:
PYTHON_VERSION: ${{ env.PYTHON_VERSION }}
TERRAFORM_VERSION: ${{ env.TERRAFORM_VERSION }}
- name: Run tests on documentation examples
2023-03-09 06:52:01 -08:00
run: pytest -vv -k modules/ tests/examples
2021-10-26 23:24:45 -07:00
2022-10-25 07:58:37 -07:00
blueprints:
2021-10-26 23:24:45 -07:00
runs-on: ubuntu-latest
steps:
2023-02-25 04:08:30 -08:00
- uses: actions/checkout@v3
2021-10-26 23:24:45 -07:00
- name: Call composite action fabric-tests
uses: ./.github/actions/fabric-tests
2021-10-26 23:24:45 -07:00
with:
PYTHON_VERSION: ${{ env.PYTHON_VERSION }}
TERRAFORM_VERSION: ${{ env.TERRAFORM_VERSION }}
- name: Run tests environments
2023-03-09 06:52:01 -08:00
run: pytest -vv tests/blueprints
2021-10-26 23:24:45 -07:00
2022-01-10 11:12:25 -08:00
modules:
2021-10-26 23:24:45 -07:00
runs-on: ubuntu-latest
steps:
2023-02-25 04:08:30 -08:00
- uses: actions/checkout@v3
2021-10-26 23:24:45 -07:00
- name: Call composite action fabric-tests
uses: ./.github/actions/fabric-tests
2021-10-26 23:24:45 -07:00
with:
PYTHON_VERSION: ${{ env.PYTHON_VERSION }}
TERRAFORM_VERSION: ${{ env.TERRAFORM_VERSION }}
2021-10-27 05:28:51 -07:00
- name: Run tests modules
2023-03-09 06:52:01 -08:00
run: pytest -vv tests/modules
2022-04-12 12:03:20 -07:00
fast:
runs-on: ubuntu-latest
steps:
2023-02-25 04:08:30 -08:00
- uses: actions/checkout@v3
2022-04-12 12:03:20 -07:00
- name: Call composite action fabric-tests
uses: ./.github/actions/fabric-tests
2022-04-12 12:03:20 -07:00
with:
PYTHON_VERSION: ${{ env.PYTHON_VERSION }}
TERRAFORM_VERSION: ${{ env.TERRAFORM_VERSION }}
2022-04-12 12:03:20 -07:00
- name: Run tests on FAST stages
2023-03-09 06:52:01 -08:00
run: pytest -vv tests/fast