Skip to content

Python 3.12 in GHA #1275

Python 3.12 in GHA

Python 3.12 in GHA #1275

Workflow file for this run

# 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
on:
push:
branches: [ master ]
pull_request: {}
jobs:
build:
strategy:
matrix:
python-version: ['3.8', '3.12']
java: [11, 13]
os: ['ubuntu-latest', 'macos-13', 'windows-latest']
terrier: ['snapshot'] #'5.3', '5.4-SNAPSHOT',
# include:
# - os: 'macos-latest'
# python-version: '3.9'
# java: 11
# terrier: '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'
- name: Install Terrier snapshot
if: matrix.terrier == '5.4-SNAPSHOT'
run: |
git clone https://github.com/terrier-org/terrier-core.git
cd terrier-core
mvn -B -DskipTests install
# 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
pip install --upgrade --upgrade-strategy eager -r requirements-test.txt
#install this software
pip install --timeout=120 .
pip install pytest
- name: Lint with flake8
run: |
#pip install flake8
# stop the build if there are Python syntax errors or undefined names
#flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
#flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Flash unit tests
env:
TERRIER_VERSION: ${{ matrix.terrier }}
run: |
pytest -p no:faulthandler tests/test_flash.py
# Hide underlying Jnius problem by disabling faulthandler: https://github.com/pytest-dev/pytest/issues/7634
- name: All unit tests
env:
TERRIER_VERSION: ${{ matrix.terrier }}
run: |
pytest --durations=20 -p no:faulthandler