Skip to content

allow redis server to be something other localhost #1246

allow redis server to be something other localhost

allow redis server to be something other localhost #1246

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
on: push
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.7, 3.8, 3.9, '3.10']
steps:
- uses: actions/checkout@v2
- name: Install APT dependencies
run: |
sudo apt-get install redis-server
curl https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O
sudo apt-get install ./google-chrome-stable_current_amd64.deb
CHROME_MAIN_VERSION=`google-chrome-stable --version | sed -E 's/(^Google Chrome |\.[0-9]+ )//g'`
echo "using chrome version $CHROME_MAIN_VERSION"
CHROMEDRIVER_VERSION=`curl -s "https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_$CHROME_MAIN_VERSION"`
echo "using driver version $CHROMEDRIVER_VERSION"
curl "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/${CHROMEDRIVER_VERSION}/linux64/chromedriver-linux64.zip" -O
unzip chromedriver-linux64.zip -d ~/bin
ulimit -c unlimited -S # enable core dumps
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip (Linux)
if: startsWith(runner.os, 'Linux')
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache pip (MacOS)
if: startsWith(runner.os, 'macOS')
uses: actions/cache@v2
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install PIP dependencies
timeout-minutes: 15 # Should run in ~2 to 3 min with cache
run: |
echo 'UPGRADE PIP'
pip install --upgrade pip==21.2.4 pip-tools wheel
echo 'INSTALL DEV REQUIREMENTS'
pip install --requirement dev-requirements.lock
echo 'INSTALL odb in editable mode'
pip install --editable .
echo 'Import ODB and see that it built correctly'
python3 -c 'import object_database._types'
- name: Install NODE dependencies
timeout-minutes: 3 # Runs in ~30 sec
run: |
make node-install
make build-js
# - name: Setup Debug SSH Session
# uses: mxschmitt/action-tmate@v3
- name: Test JS
timeout-minutes: 3 # runs in ~10 sec
env:
TRAVIS_CI: 1
run: |
make js-test
- name: Test Python
timeout-minutes: 20 # Runs in ~10 min
env:
TRAVIS_CI: 1
PYTHONUNBUFFERED: true
run: |
make testcert.cert
pytest --verbose --capture=no --log-level=info --log-cli-level=info
pip-install:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.7, 3.8, 3.9, '3.10']
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: pip install object_database from github
timeout-minutes: 10 # Runs in ~3 min
run: |
python --version
pip --version
pip freeze
pip install -v git+https://github.com/APrioriInvestments/object_database.git@${GITHUB_SHA}
- name: import object_database
timeout-minutes: 1 # Runs in <10 sec
run : |
pip freeze
python -c "import typed_python"
python -c "import object_database"
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
timeout-minutes: 2 # Runs in 15 sec
run: |
python -m pip install --upgrade pip
pip install flake8==3.8.4 safety black==19.3b0
- name: Check black and lint
timeout-minutes: 2 # Runs in 15 sec
run: |
pip install --upgrade pip pip-tools wheel
pip install --requirement dev-requirements.lock
make lint-local
make black-check-local