Test #93
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: 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' ] | |
java-version: [ 8, 11, 17 ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
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@v3 | |
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 | |
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@v3 | |
with: | |
submodules: recursive | |
- name: Install Poetry | |
run: pipx install poetry | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
cache: poetry | |
cache-dependency-path: pyproject.toml | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- 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 | |
poetry run invoke build --sdist --wheel |