Skip to content

build(deps): bump flask-cors from 4.0.0 to 4.0.1 in /locust #98

build(deps): bump flask-cors from 4.0.0 to 4.0.1 in /locust

build(deps): bump flask-cors from 4.0.0 to 4.0.1 in /locust #98

Workflow file for this run

# 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
#
# https://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.
# This is a basic workflow to help you get started with Actions
name: spanner-stress-demo-auto-test
# Controls when the workflow will run
on:
push:
branches:
- main
pull_request:
types: [synchronize, opened]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: [ubuntu-latest]
# Steps represent a sequence of tasks that will be executed as part of the job
timeout-minutes: 30
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Pull repo
uses: actions/checkout@v3
- name: Read python version file
id: python-version
uses: juliangruber/read-file-action@v1
with:
path: .python-version
- name: Install python
uses: gabrielfalcao/pyenv-action@v16
with:
default: "${{ steps.python-version.outputs.content }}"
command: |
pip install -U pip
pip install pipenv
- name: Lint check for python files
run: |
pip install flake8
flake8 . --ignore=E501 --extend-exclude=terraform
- name: Lint check for yaml files
run: |
pip install yamllint
yamllint -d "{extends: relaxed, rules: {line-length: {max: 200}}}" -f standard ./
- name: Lint check for terraform files
uses: actionshub/terraform-lint@main
- name: Read terraform version file
id: terraform-version
uses: juliangruber/read-file-action@v1
with:
path: .terraform-version
- name: Install terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: "${{ steps.terraform-version.outputs.content }}"
- name: Validate terraform files
run: |
cp .env_sample .env && make terraform.init
cd terraform && terraform validate
- name: Install dev package in local
run: cd apps && pipenv install --dev
- name: Install google-cloud-cli
run: |
bash <(curl https://sdk.cloud.google.com) --disable-prompts --install-dir=/usr/local/bin
echo "/usr/local/bin/google-cloud-sdk/bin" >> $GITHUB_PATH
- name: Create config for unit-test
run: make create.emulator.config
- name: Set emulator config
run: make set.emulator.config
- name: Run spanner emulator container
run: docker-compose up -d spanner
- name: Create database in spanner emulator
run: |
sleep 3
make create.emulator.database
- name: Run unit-test
run: cd apps && ENV=local SPANNER_EMULATOR_HOST=localhost:9010 GOOGLE_CLOUD_PROJECT=test-local pipenv run ci_test
# - name: Submit coverage comments of unit-test
# id: coverage_comment
# uses: MishaKav/pytest-coverage-comment@main
# with:
# pytest-xml-coverage-path: ./apps/coverage.xml
# junitxml-path: ./apps/pytest.xml
- name: Run app container
run: |
docker-compose down
make run.local-app
- name: Run integration-test to load master data
run: |
pip install -r apps/scripts/requirements.txt
python ./apps/scripts/main.py -l 10
- name: Run integration-test of simple stress test in local
run: make run.local-locust
- name: Check the number of running container
run: |
sleep 10
if [ $(docker-compose ps | grep Up | wc -l) -ne 6 ]
then
echo "Does not running some containers"
docker-compose ps
exit 1
fi
- name: Output locust logs to check failed-rate
run: docker-compose logs --tail=200 locust
- name: Stop containers
if: always()
run: docker-compose down