test_ci #1138
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 qlib from source | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
timeout-minutes: 180 | |
# we may retry for 3 times for `Unit tests with Pytest` | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-20.04, ubuntu-22.04, macos-11, macos-latest] | |
# not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 | |
python-version: [3.7, 3.8] | |
steps: | |
- name: Test qlib from source | |
uses: actions/checkout@v3 | |
# Since version 3.7 of python for MacOS is installed in CI, version 3.7.17, this version causes "_bz not found error". | |
# So we make the version number of python 3.7 for MacOS more specific. | |
# refs: https://github.com/actions/setup-python/issues/682 | |
- name: Set up Python ${{ matrix.python-version }} | |
if: (matrix.os == 'macos-latest' && matrix.python-version == '3.7') || (matrix.os == 'macos-11' && matrix.python-version == '3.7') | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.7.16" | |
- name: Set up Python ${{ matrix.python-version }} | |
if: (matrix.os != 'macos-latest' || matrix.python-version != '3.7') && (matrix.os != 'macos-11' || matrix.python-version != '3.7') | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Update pip to the latest version | |
# pip release version 23.1 on Apr.15 2023, CI failed to run, Please refer to #1495 ofr detailed logs. | |
# The pip version has been temporarily fixed to 23.0 | |
run: | | |
python -m pip install --upgrade pip | |
- name: Set up Python tools | |
run: | | |
python -m pip install --upgrade cython | |
python -m pip install numpy<1.24 | |
python setup.py bdist_wheel | |
python -c "from pathlib import Path; current_directory = Path.cwd(); dist_directory = current_directory / 'dist'; files = dist_directory.glob('*'); [print(file.name) for file in files]" | |
python -c "import sysconfig; print(sysconfig.get_platform())" | |