Python Tests #298
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: Python Tests | |
on: | |
workflow_run: | |
workflows: ["Build and Deploy"] | |
branches: [main] | |
types: | |
- completed | |
pull_request: | |
branches: main | |
jobs: | |
test: | |
name: ${{ matrix.CONDA_ENV }}-test | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
CONDA_ENV: [unpinned] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Cache conda environment | |
uses: actions/cache@v2 | |
env: | |
# Increase this value to reset cache if environment.yml has not changed | |
CACHE_NUMBER: 0 | |
with: | |
path: ~/conda_pkgs_dir | |
key: > | |
${{ format('{0}-conda-{1}-{2}', | |
runner.os, | |
env.CACHE_NUMBER, | |
hashFiles(format('clients/python/ci/environment-{0}.yml', matrix.CONDA_ENV))) }} | |
- name: Setup miniconda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
auto-activate-base: false | |
activate-environment: sliderule-ci | |
environment-file: clients/python/ci/environment-${{ matrix.CONDA_ENV }}.yml | |
use-only-tar-bz2: true | |
- name: Install sliderule from current commit | |
shell: bash -l {0} | |
run: | | |
cd clients/python | |
python -m pip install . | |
conda list | |
- name: Install netrc for authentication | |
shell: bash -l {0} | |
run: | | |
echo "${{ secrets.NETRC }}" > $HOME/.netrc | |
chmod 600 $HOME/.netrc | |
- name: Run tests | |
shell: bash -l {0} | |
run: | | |
cd clients/python | |
python -m pytest --verbose --organization developers --desired_nodes 3 |