Merge pull request #56 from dheemantha-bhat/main #407
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
# Run tests and integration tests on Mac, which are triggered by each main push. | |
# Currently, Python3.10 is only used as an environment. | |
# This is mainly for the sake of speed. | |
name: mac-tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
paths: | |
- '.github/workflows/mac-tests.yml' | |
schedule: | |
- cron: '0 23 * * SUN-THU' | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
tests-mac: | |
runs-on: macos-latest | |
# Not intended for forks. | |
if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna-integration') || (github.event_name != 'schedule') | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Python3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Setup cache | |
uses: actions/cache@v2 | |
env: | |
cache-name: test | |
with: | |
path: ~/Library/Caches/pip | |
key: ${{ runner.os }}-3.10-${{ env.cache-name }}-${{ hashFiles('**/pyproject.toml') }}-v1 | |
restore-keys: | | |
${{ runner.os }}-3.10-${{ env.cache-name }}-${{ hashFiles('**/pyproject.toml') }} | |
- name: Setup mac environment | |
run: | | |
brew install openblas | |
- name: Install | |
run: | | |
python -m pip install --upgrade pip | |
# Install minimal dependencies and confirm that `import optuna` is successful. | |
pip install --progress-bar off . | |
pip install --progress-bar off .[test] | |
pip install --progress-bar off .[all] | |
# Install optuna from optuna master | |
pip install git+https://github.com/optuna/optuna@master | |
# Install distributed to run importance_tests/test_init tests. | |
pip install distributed | |
- name: Output installed packages | |
run: | | |
pip freeze --all | |
- name: Output dependency tree | |
run: | | |
pip install pipdeptree | |
pipdeptree | |
- name: Tests | |
run: | | |
pytest tests \ | |
--ignore tests/test_mxnet.py | |
env: | |
OMP_NUM_THREADS: 1 | |
- name: Tests(Deprecated) | |
run: | | |
pip install "numpy<1.24" | |
pytest tests/test_mxnet.py |