-
-
Notifications
You must be signed in to change notification settings - Fork 404
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #591 from Farama-Foundation/windows-workflows
Windows workflow + other workflows update
- Loading branch information
Showing
8 changed files
with
228 additions
and
19 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
name: Build and test Python wheels for Windows and make PyPI release | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
paths: | ||
- '.github/workflows/build-and-test-windows-wheels.yml' | ||
- 'include/**' | ||
- 'scripts/**' | ||
- 'src/**' | ||
- 'CMakeLists.txt' | ||
- 'setup.py' | ||
- 'pyproject.toml' | ||
branches: [master] | ||
pull_request: | ||
paths: | ||
- '.github/workflows/**' | ||
- 'include/**' | ||
- 'scripts/**' | ||
- 'src/**' | ||
- 'tests/**' | ||
- 'CMakeLists.txt' | ||
- 'setup.py' | ||
- 'pyproject.toml' | ||
release: | ||
types: [published] | ||
|
||
env: | ||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | ||
BUILD_TYPE: Release | ||
# Set paths to dependencies here | ||
BOOST_DIR: ${{ github.workspace }}\deps\boost | ||
DXSDK_DIR: ${{ github.workspace }}\deps\DXSDK | ||
OPENALDIR: ${{ github.workspace }}\deps\openal-soft | ||
# Point to the correct generator and dependencies | ||
VIZDOOM_WIN_DEPS_ROOT: ${{ github.workspace }}\deps | ||
VIZDOOM_BUILD_GENERATOR_NAME: Visual Studio 17 2022 | ||
|
||
jobs: | ||
build_and_test_wheels: | ||
strategy: | ||
matrix: | ||
os: [windows-2022] | ||
python-version: ['3.9', '3.10', '3.11', '3.12'] | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
# Gather all dependencies | ||
- name: Set up Python ${{ matrix.python-version }} environment | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Python environment report | ||
run: python -c "import sys; print(sys.version)" | ||
|
||
- name: Get deps repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: mwydmuch/ViZDoomWinDepBin | ||
path: ${{ github.workspace }}\deps | ||
|
||
- name: Install boost | ||
uses: MarkusJx/[email protected] | ||
id: install-boost | ||
with: | ||
# REQUIRED: Specify the required boost version | ||
# A list of supported versions can be found here: | ||
# https://github.com/actions/boost-versions/blob/main/versions-manifest.json | ||
boost_version: 1.73.0 | ||
# OPTIONAL: Specify a toolset on windows | ||
toolset: msvc14.2 | ||
# OPTIONAL: Specify a custom install location | ||
boost_install_dir: ${{ github.workspace }}\deps | ||
|
||
- name: Download DXSDK | ||
id: download-dxsdk | ||
working-directory: ${{ github.workspace }}/deps | ||
run: | | ||
curl -L https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe -o _DX2010_.exe | ||
7z x _DX2010_.exe DXSDK/Include -o_DX2010_ | ||
7z x _DX2010_.exe DXSDK/Lib -o_DX2010_ | ||
mv _DX2010_/DXSDK . | ||
rm -fR _DX*_ _DX*_.exe | ||
shell: bash | ||
|
||
- name: Report working directory structure (cmd) | ||
run: | | ||
dir . | ||
dir deps | ||
- name: Report working directory structure (bash) | ||
shell: bash | ||
run: | | ||
ls -la . | ||
ls -la deps | ||
- name: Report env (bash) | ||
shell: bash | ||
env: | ||
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} | ||
run: | | ||
echo $BUILD_TYPE | ||
echo $BOOST_DIR | ||
echo $BOOST_ROOT | ||
echo $DXSDK_DIR | ||
echo $VIZDOOM_BUILD_GENERATOR_NAME | ||
echo $VIZDOOM_WIN_DEPS_ROOT | ||
# Build | ||
- name: Python environment report | ||
run: python -c "import sys; print(sys.version)" | ||
|
||
- name: CMake report | ||
run: cmake --version | ||
|
||
- name: Build | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade numpy | ||
python -m pip install --upgrade setuptools wheel twine | ||
python setup.py bdist_wheel | ||
- name: Report built wheels (bash) | ||
shell: bash | ||
run: | | ||
ls -l ./dist/*.whl | ||
# Test | ||
- name: Install wheel (bash) | ||
shell: bash | ||
run: | | ||
python -m pip install $(ls dist/vizdoom-*.whl)[test] | ||
- name: Test | ||
run: | | ||
python -m pytest tests | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./dist/*.whl | ||
|
||
upload_pypi: | ||
name: Upload to PyPI | ||
needs: [build_and_test_wheels] | ||
runs-on: ubuntu-latest | ||
environment: pypi | ||
permissions: | ||
id-token: write | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
steps: | ||
- name: Download all dists | ||
uses: actions/download-artifact@v3 | ||
with: | ||
# Unpacks default artifact into dist/ | ||
# If `name: artifact` is omitted, the action will create extra parent dir | ||
name: artifact | ||
path: dist | ||
|
||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
# To test: | ||
# with: | ||
# repository_url: https://test.pypi.org/legacy/ |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ on: | |
workflow_dispatch: | ||
push: | ||
paths: | ||
- '.github/workflows/**' | ||
- '.github/workflows/build-wheels.yml' | ||
- 'include/**' | ||
- 'scripts/**' | ||
- 'src/**' | ||
|
@@ -21,29 +21,49 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-22.04, macos-11] | ||
os: [ubuntu-22.04, macos-13, macos-14] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Report OS | ||
run: | | ||
echo ${{ matrix.os }} | ||
echo ${{ runner.os }} | ||
uname -p | ||
- name: Set up QEMU | ||
if: runner.os == 'Linux' | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: all | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
- name: Build manylinux wheels | ||
if: matrix.os == 'ubuntu-22.04' | ||
uses: pypa/[email protected] | ||
env: | ||
# Configure cibuildwheel to build native archs, and some emulated ones | ||
CIBW_ARCHS_LINUX: x86_64 aarch64 | ||
CIBW_ARCHS_MACOS: x86_64 | ||
CIBW_BUILD_VERBOSITY: 3 | ||
CIBW_REPAIR_WHEEL_COMMAND_LINUX: > | ||
auditwheel show {wheel} && auditwheel repair -w {dest_dir} {wheel} | ||
- name: Build macOS Intel wheels | ||
if: matrix.os == 'macos-13' | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_ARCHS_MACOS: x86_64 | ||
CIBW_BUILD_VERBOSITY: 3 | ||
|
||
- name: Build macOS Apple Silicon wheels | ||
if: matrix.os == 'macos-14' | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_ARCHS_MACOS: arm64 | ||
CIBW_BUILD_VERBOSITY: 3 | ||
|
||
- name: Report built wheels | ||
run: | | ||
ls -l ./wheelhouse/*.whl | ||
|
@@ -57,7 +77,7 @@ jobs: | |
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
|
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
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