Skip to content

Merge test workflows and add installation caches (not operational atm) #12

Merge test workflows and add installation caches (not operational atm)

Merge test workflows and add installation caches (not operational atm) #12

Workflow file for this run

name: pytest_all
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test-ubuntu:
name: "pytest_${{ matrix.suffix }} on ${{ matrix.python-version }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
suffix: ["core", "algorithms", "benchmarks", "clients", "pyglove", "raytune"]
include:
- suffix: "clients"
python-version: "3.7"
- suffix: "clients"
python-version: "3.8"
steps:
- name: Clone repo
uses: actions/checkout@v3.5.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: '**/requirements-test.txt'
- name: Cache dependencies
# This was taken from: https://github.com/actions/setup-python/issues/330#issuecomment-1500667578
uses: actions/cache@v3.3.1
id: cache
with:
path: ${{ env.pythonLocation }}
key: >-
${{ env.pythonLocation }}
${{ hashFiles('**/requirements*.txt') }}
- name: Install essential dependencies
run: |
sudo apt-get install -y libprotobuf-dev
python -m pip install --upgrade pip setuptools
pip install wheel
pip install grpcio-tools==1.48.2
pip install pytest pytest-xdist
pip wheel -e .
pip install -e . \
pip install -r requirements-test.txt \
- name: Print installed dependencies
run: pip list
- name: Run test
run: bash run_tests.sh ${{ matrix.suffix }} run