Merge pull request #649 from rte-france/dev_1.10.4 #100
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: CI | |
on: | |
push: | |
branches: | |
- '*' | |
tags: | |
- 'v*.*.*' | |
jobs: | |
manylinux_build: | |
name: Build linux ${{ matrix.python.name }} wheel | |
runs-on: ubuntu-latest | |
container: quay.io/pypa/manylinux2014_x86_64 | |
env: | |
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true | |
GHA_USE_NODE_20: false | |
strategy: | |
matrix: | |
python: | |
- { | |
name: cp38, | |
abi: cp38, | |
version: '3.8', | |
} | |
- { | |
name: cp39, | |
abi: cp39, | |
version: '3.9', | |
} | |
- { | |
name: cp310, | |
abi: cp310, | |
version: '3.10', | |
} | |
- { | |
name: cp311, | |
abi: cp311, | |
version: '3.11', | |
} | |
- { | |
name: cp312, | |
abi: cp312, | |
version: '3.12', | |
} | |
# - { | |
# name: cp313, # issue with pandapower atm | |
# abi: cp313, | |
# version: '3.13', | |
# } | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Setup path | |
run: echo "/opt/python/${{ matrix.python.name }}-${{ matrix.python.abi }}/bin/" >> $GITHUB_PATH | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade wheel | |
python -m pip install --upgrade setuptools | |
- name: Build wheel | |
run: | | |
python setup.py bdist_wheel | |
# auditwheel repair dist/*.whl # only for compiled code ! | |
- name: Install wheel | |
run: | | |
pip3 install dist/*.whl | |
pip freeze | |
- name: Check package can be imported | |
run: | | |
python -c "import grid2op" | |
python -c "from grid2op import *" | |
python -c "from grid2op.Action._backendAction import _BackendAction" | |
- name: List wheel | |
run: | |
ls ./dist/*.whl | |
- name: Upload wheel | |
uses: actions/upload-artifact@v3 | |
with: | |
name: grid2op-wheel-${{ matrix.config.name }}-${{ matrix.python.name }} | |
path: dist/*.whl | |
macos_windows_build: | |
name: Build ${{ matrix.config.name }} ${{ matrix.python.name }} wheel | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
matrix: | |
config: | |
- { | |
name: darwin, | |
os: macos-latest, | |
} | |
- { | |
name: windows, | |
os: windows-2019, | |
} | |
python: | |
- { | |
name: cp38, | |
version: '3.8', | |
} | |
- { | |
name: cp39, | |
version: '3.9', | |
} | |
- { | |
name: cp310, | |
version: '3.10', | |
} | |
- { | |
name: cp311, | |
version: '3.11', | |
} | |
- { | |
name: cp312, | |
version: '3.12', | |
} | |
# - { # issue with pandapower atm | |
# name: cp313, | |
# version: '3.13', | |
# } | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python.version }} | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade wheel | |
python -m pip install --upgrade setuptools | |
- name: Build wheel | |
run: python setup.py bdist_wheel | |
- name: Install wheel | |
shell: bash | |
run: | | |
python -m pip install dist/*.whl --user | |
pip freeze | |
- name: Check package can be imported | |
run: | | |
python -c "import grid2op" | |
python -c "from grid2op import *" | |
python -c "from grid2op.Action._backendAction import _BackendAction" | |
- name: Build source archive | |
if: matrix.config.name == 'darwin' && matrix.python.name == 'cp310' | |
run: python setup.py sdist | |
- name: Upload wheel | |
uses: actions/upload-artifact@v4 | |
with: | |
name: grid2op-wheel-${{ matrix.config.name }}-${{ matrix.python.name }} | |
path: dist/*.whl | |
- name: Upload source archive | |
uses: actions/upload-artifact@v4 | |
if: matrix.config.name == 'darwin' && matrix.python.name == 'cp310' | |
with: | |
name: grid2op-sources | |
path: dist/*.tar.gz | |
auto_class_in_file: | |
name: Test ${{ matrix.config.name }} OS can handle automatic class generation | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
matrix: | |
config: | |
- { | |
name: darwin, | |
os: macos-latest, | |
} | |
# - { | |
# name: windows, | |
# os: windows-2019, | |
# } | |
- { | |
name: ubuntu, | |
os: ubuntu-latest, | |
} | |
python: | |
- { | |
name: cp39, | |
version: '3.9', | |
} | |
- { | |
name: cp312, | |
version: '3.12', | |
} | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python.version }} | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade wheel | |
python -m pip install --upgrade setuptools | |
python -m pip install --upgrade gymnasium "numpy<2" | |
- name: Build wheel | |
run: python setup.py bdist_wheel | |
- name: Install wheel | |
shell: bash | |
run: | | |
python -m pip install dist/*.whl --user | |
pip freeze | |
- name: Test the automatic generation of classes in the env folder | |
run: | | |
python -m unittest grid2op/tests/automatic_classes.py -f | |
package: | |
name: Test install | |
runs-on: ubuntu-latest | |
needs: [manylinux_build, macos_windows_build, auto_class_in_file] | |
steps: | |
- name: Download wheels | |
uses: actions/download-artifact@v4 | |
with: | |
path: download | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: grid2op-wheels | |
path: | | |
download/**/*.whl | |
download/**/*.tar.gz |