Skip to content

Windows tests

Windows tests #202

Workflow file for this run

# Run tests and integration tests on Windows, which are triggered by each master push.
# Currently, Python3.9 is only used as an environment.
# This is mainly for the sake of speed.
name: windows-tests
on:
push:
branches:
- master
pull_request: {}
schedule:
- cron: '0 23 * * SUN-THU'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }}
cancel-in-progress: true
jobs:
tests-windows:
runs-on: windows-latest
# Not intended for forks.
if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna') || (github.event_name != 'schedule')
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python3.9
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Setup cache
uses: actions/cache@v3
env:
cache-name: windows-test
with:
path: ~\\AppData\\Local\\pip\\Cache
key: ${{ runner.os }}-3.9-${{ env.cache-name }}-${{ hashFiles('**/pyproject.toml') }}-v1
restore-keys: |
${{ runner.os }}-3.9-${{ env.cache-name }}-${{ hashFiles('**/pyproject.toml') }}
- name: Install
run: |
python -m pip install --upgrade pip
pip install --progress-bar off -U setuptools
# Install minimal dependencies and confirm that `import optuna` is successful.
pip install --progress-bar off .
python -c 'import optuna'
optuna --version
pip install --progress-bar off .[test]
pip install --progress-bar off .[optional]
pip install PyQt6 # Install PyQT for using QtAgg as matplotlib backend.
- name: Output installed packages
run: |
pip freeze --all
- name: Output dependency tree
run: |
pip install pipdeptree
pipdeptree
- name: Scheduled tests
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
run: |
pytest -m "not integration"
env:
SQLALCHEMY_WARN_20: 1
MPLBACKEND: "QtAgg" # Use QtAgg as matplotlib backend.
- name: Tests
if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }}
run: |
pytest -m "not integration and not slow"
env:
MPLBACKEND: "QtAgg" # Use QtAgg as matplotlib backend.
tests-integration-windows:
runs-on: windows-latest
# Not intended for forks.
if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna') || (github.event_name != 'schedule')
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python3.9
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Setup cache
uses: actions/cache@v3
env:
cache-name: windows-test-integration
with:
path: ~\\AppData\\Local\\pip\\Cache
key: ${{ runner.os }}-3.9-${{ env.cache-name }}-${{ hashFiles('**/pyproject.toml') }}-v1
restore-keys: |
${{ runner.os }}-3.9-${{ env.cache-name }}-${{ hashFiles('**/pyproject.toml') }}
- name: Setup MPI
uses: mpi4py/setup-mpi@v1
with:
mpi: "msmpi"
- name: Install
run: |
python -m pip install --upgrade pip
pip install --progress-bar off -U setuptools
# Install minimal dependencies and confirm that `import optuna` is successful.
pip install --progress-bar off .
python -c 'import optuna'
optuna --version
pip install --progress-bar off .[test]
pip install --progress-bar off .[optional]
pip install --progress-bar off .[integration]
pip install "distributed<2023.3.2"
- name: Output installed packages
run: |
pip freeze --all
- name: Output dependency tree
run: |
pip install pipdeptree
pipdeptree
- name: Tests
# Skip allennlp tests since it's not supported on Windows.
run: |
pytest tests -m "integration" `
--ignore tests/integration_tests/allennlp_tests/test_allennlp.py `
env:
OMP_NUM_THREADS: 1