Merge test workflows and add installation caches (not operational atm) #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: pytest_all | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
test-ubuntu: | |
name: "pytest_${{ matrix.suffix }} on ${{ matrix.python-version }} on ${{ matrix.os }}" | |
runs-on: "${{ matrix.os }}" | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9"] | |
os: ["ubuntu-latest"] | |
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*.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 . \ | |
- name: Install pip dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
pip install -r requirements-algorithms.txt \ | |
-r requirements-benchmarks.txt \ | |
-r requirements-jax.txt \ | |
-r requirements-test.txt \ | |
-r requirements-tf.txt \ | |
-r requirements.txt | |
- name: Print installed dependencies | |
run: pip list | |
- name: Run test | |
run: bash run_tests.sh ${{ matrix.suffix }} |