Skip to content

Update dependencies flagged by Twistlock scan [on-prem deployments] #441

Update dependencies flagged by Twistlock scan [on-prem deployments]

Update dependencies flagged by Twistlock scan [on-prem deployments] #441

name: build
on:
push:
branches: [ master, feat/python_3.10_support, 0.9.x ]
pull_request:
branches: [ master, 0.9.x ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, '3.10']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
virtualenvs-in-project: false
installer-parallel: false
- name: Install dependencies
run: |
python -m pip install coverage black mypy pytest types-pytz types-requests
if [ -f pyproject.toml ]; then poetry run pip install 'setuptools==57.5.0'; poetry install --no-root; fi
- name: Lint with black and static type check with mypy
run: |
# stop the build if there are Python syntax errors or undefined names
black .
mypy dialogy --install-types
- name: Test with pytest and get Coverage
run: |
poetry run pytest --cov=dialogy --cov-report=xml tests/
coverage report | tee cov.out
echo "covpercentage=$(cat cov.out | tail -n1 | awk -F ' ' '{print $4}' | sed 's/.$//')" >> "$GITHUB_ENV"
- name: Upload coverage data to coverage
uses: codecov/codecov-action@v2
with:
flags: unittests
fail_ci_if_error: true
verbose: true
- name: Check if coverage less than 90%
if: env.covpercentage < '90'
uses: actions/github-script@v3
with:
script: |
core.setFailed('Code Coverage is less that 90%')