Skip to content

Test

Test #138

Workflow file for this run

name: Test
on:
pull_request:
push:
schedule:
- cron: '0 0 1 * *' # monthly
workflow_dispatch:
jobs:
test:
strategy:
fail-fast: false
matrix:
python-version: [ 3.7, 3.8, 3.9, '3.10', '3.11', '3.12' ]
java-version: [ 8, 11, 17, 21 ]
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache for pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java-version }}
- name: Cache for Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ matrix.java-version }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-${{ matrix.java-version }}-
${{ runner.os }}-gradle-
- name: Install dependencies
run: pip install tox tox-gh-actions
- name: Run tox (default, pyjnius)
run: tox
- name: Run tox (py4j)
env:
DONUTS_PYTHON_BACKEND: py4j
run: tox
- name: Run tox (jpype)
env:
DONUTS_PYTHON_BACKEND: jpype
run: tox
readme_dev:
# Test the code in "Development" in README.rst.
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: poetry
cache-dependency-path: pyproject.toml
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Test the development section
run: |
git submodule update --init
poetry install
poetry run invoke prepare
poetry run invoke build
poetry run invoke fmt
poetry run invoke lint
poetry run invoke test
# poetry run invoke bench # skip it because too slow
poetry run invoke doc
DONUTS_PYTHON_BACKEND=pyjnius poetry run invoke test
DONUTS_PYTHON_BACKEND=py4j poetry run invoke test
DONUTS_PYTHON_BACKEND=jpype poetry run invoke test
poetry run invoke build --sdist --wheel