Skip to content

Merge pull request #101 from fredliporace/dev #99

Merge pull request #101 from fredliporace/dev

Merge pull request #101 from fredliporace/dev #99

Workflow file for this run

name: CI
on:
push:
paths-ignore:
- '**/*.md'
pull_request:
jobs:
tests:
# if: github.event_name == 'push' || github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.7.9]
steps:
- uses: hmarr/debug-action@v2
# Hacks (act, ES on localstack)
- run: |
# Hack to get setup-python to work on act
# https://github.com/nektos/act/issues/251#issuecomment-706412948
if [ ! -f "/etc/lsb-release" ] ; then
echo "DISTRIB_RELEASE=20.04" > /etc/lsb-release
fi
# Hack needed for ES to start
if [ ! -d "/tmp/localstack/es_backup" ] ; then
mkdir -p /tmp/localstack/es_backup
fi
- uses: actions/checkout@v2
- name: Start localstack from docker-compose.yml
# localstack is not started for local testing using act
if: github.actor != 'nektos/act'
run: |
cd test && docker-compose up -d
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Check cache
if: ${{ !env.ACT }}
uses: actions/cache@v2
env:
cache-name: cache-pip-pre-commit
with:
path: |
~/.cache/pip
~/.cache/pre-commit
.tox
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('setup.py', 'constraints.txt') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox codecov pre-commit
# Needed to install pylint and all imported packages
python -m pip install .[dev,deploy,test] -c constraints.txt
- name: run pre-commit
run: pre-commit run --all-files
# Installs packages on lambdas directories
- name: Install packages on lambdas
run: ./pip-on-lambdas.sh
# Run tox using the version of Python in `PATH`
# Always displays docker-compose logs for debugging
# add || (cd test && docker-compose logs && false)
- name: Run Tox
run: |
tox -e py || (cd test && docker-compose logs && false)
# - name: Upload Results
# if: success()
# uses: codecov/codecov-action@v1
# with:
# file: ./coverage.xml
# flags: unittests
# name: ${{ matrix.platform }}-${{ matrix.tox-env }}
# fail_ci_if_error: false