Python 3.12 in GHA #11
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
# 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: Continuous Testing of Anserini Integration | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
python-version: ['3.10'] | |
anserini-version: ['==0.19.0', '==0.22.0', '==0.36.0', ''] | |
java: [21] | |
os: ['ubuntu-latest'] | |
terrier: ['snapshot'] #'5.3', '5.4-SNAPSHOT', | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Setup dependencies for xgBoost on macOs-latest | |
if: matrix.os == 'macOs-latest' | |
run: | | |
brew install libomp | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
if: matrix.os != 'self-hosted' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Setup java | |
if: matrix.os != 'self-hosted' | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: 'zulu' | |
# follows https://medium.com/ai2-blog/python-caching-in-github-actions-e9452698e98d | |
- name: Loading Python & dependencies from cache | |
if: matrix.os != 'self-hosted' | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.pythonLocation }} | |
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-test.txt') }} | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install --upgrade --upgrade-strategy eager -r requirements.txt | |
#install this software | |
pip install --timeout=120 . | |
pip install pytest | |
- name: Anserini unit tests (Python > 3.7) | |
if: matrix.python-version != '3.7' | |
env: | |
TERRIER_VERSION: ${{ matrix.terrier }} | |
run: | | |
pip install pyserini${{ matrix.anserini-version }} faiss-cpu torch | |
pytest --durations=20 -p no:faulthandler tests/anserini/ |