Skip to content

Merge pull request #63 from terrierteam/gha-upgrade #252

Merge pull request #63 from terrierteam/gha-upgrade

Merge pull request #63 from terrierteam/gha-upgrade #252

Workflow file for this run

name: Test Python package
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
python: [3.8]
java: [13]
os: ['ubuntu-latest'] #
architecture: ['x64']
terrier: ['snapshot'] #'5.3', '5.4-SNAPSHOT',
transformers: ['==3.0.2', ">=4"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup java
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
architecture: ${{ matrix.architecture }}
distribution: 'zulu'
- name: Setup conda
uses: s-weigand/setup-conda@v1
with:
python-version: ${{ matrix.python }}
conda-channels: anaconda, conda-forge
activate-conda: true
# follows https://medium.com/ai2-blog/python-caching-in-github-actions-e9452698e98d
- name: Loading Python & dependencies from cache
uses: actions/cache@v3
with:
path: /usr/share/miniconda/lib/python3.8/site-packages/
key: /usr/share/miniconda/lib/python3.8/site-packages/-${{ hashFiles('requirements.txt') }}
- name: Loading Torch models from cache
uses: actions/cache@v3
with:
path: /home/runner/.cache/
key: uog44k_only
- name: Install Python dependencies
run: |
conda install pip
conda install mkl_fft -y
conda install -c pytorch faiss-cpu=1.6.3
pip install --upgrade --upgrade-strategy eager git+https://github.com/terrier-org/pyterrier.git#egg=python-terrier
pip install --upgrade --upgrade-strategy eager -r requirements.txt
# transformers 3 cant use torch 1.12
if [ "${{matrix.transformers}}" == "<4" ]; then pip install torch==1.8.0 setuptools==59.5.0; fi
#install this software
pip install --timeout=120 .
pip install 'transformers${{matrix.transformers}}'
pip install --upgrade --upgrade-strategy eager pytest
conda list
- name: All unit tests
env:
TERRIER_VERSION: ${{ matrix.terrier }}
run: |
pytest -s