@@ -41,43 +41,66 @@ jobs:
41
41
strategy :
42
42
matrix :
43
43
cfg :
44
- - { name: 'Linux LLVM+libstdc++', os: 'ubuntu-22.04', platform: 'manylinux_2_35_x86_64', cc: clang, cxx: clang++, config: --linkopt=-fuse-ld=lld }
45
- - { name: 'MacOS 11 x86_64 LLVM+libc++', os: 'macos-11', platform: 'macosx_11_0_x86_64', cc: clang, cxx: clang++, config: --config=libc++ --config=macos }
46
- - { name: 'MacOS 12 x86_64 LLVM+libc++', os: 'macos-12', platform: 'macosx_12_0_x86_64', cc: clang, cxx: clang++, config: --config=libc++ --config=macos }
47
- - { name: 'MacOS 13 x86_64 LLVM+libc++', os: 'macos-13', platform: 'macosx_13_0_x86_64', cc: clang, cxx: clang++, config: --config=libc++ --config=macos }
48
- - { name: 'MacOS 12 ARM64 LLVM+libc++', os: 'macos-12', platform: 'macosx_12_0_arm64', cc: clang, cxx: clang++,
44
+ - { name: 'Linux LLVM+libstdc++', os: 'ubuntu-22.04', cc: clang, cxx: clang++, config: --linkopt=-fuse-ld=lld }
45
+ - { name: 'MacOS 11 x86_64 LLVM+libc++', os: 'macos-11', cc: clang, cxx: clang++, config: --config=libc++ --config=macos }
46
+ - { name: 'MacOS 12 x86_64 LLVM+libc++', os: 'macos-12', cc: clang, cxx: clang++, config: --config=libc++ --config=macos }
47
+ - { name: 'MacOS 13 x86_64 LLVM+libc++', os: 'macos-13', cc: clang, cxx: clang++, config: --config=libc++ --config=macos }
48
+ - { name: 'MacOS 12 ARM64 LLVM+libc++', os: 'macos-12', cc: clang, cxx: clang++,
49
49
config : --config=libc++ --config=macos_arm64 --repo_env=PY_PLATFORM_OVERRIDE=macosx_12_0_arm64 }
50
- - { name: 'MacOS 13 ARM64 LLVM+libc++', os: 'macos-13', platform: 'macosx_13_0_arm64', cc: clang, cxx: clang++,
50
+ - { name: 'MacOS 13 ARM64 LLVM+libc++', os: 'macos-13', cc: clang, cxx: clang++,
51
51
config : --config=libc++ --config=macos_arm64 --repo_env=PY_PLATFORM_OVERRIDE=macosx_13_0_arm64 }
52
- py :
53
- - { version: '3.8', interp: 'cp38', abi: 'cp38' }
54
- - { version: '3.9', interp: 'cp39', abi: 'cp39' }
55
- - { version: '3.10', interp: 'cp310', abi: 'cp310' }
56
- - { version: '3.11', interp: 'cp311', abi: 'cp311' }
52
+ python-version :
53
+ - ' 3.8'
54
+ - ' 3.9'
55
+ - ' 3.10'
56
+ - ' 3.11'
57
57
58
58
env :
59
59
CC : ${{ matrix.cfg.cc }}
60
60
CXX : ${{ matrix.cfg.cxx }}
61
+ WHEEL_NAME : ' '
61
62
62
63
steps :
63
64
- uses : actions/checkout@v3
64
65
65
66
- uses : actions/setup-python@v3
66
67
with :
67
- python-version : ${{ matrix.py. version }}
68
+ python-version : ${{ matrix.python- version }}
68
69
69
70
- name : Install Python Dependencies
70
- run : pip3 install --upgrade pip packaging
71
+ run : pip3 install --upgrade pip packaging check-wheel-contents
71
72
72
- - name : Build for Python ${{ matrix.py. version }}
73
+ - name : Build for Python ${{ matrix.python- version }}
73
74
run : bazel --bazelrc=.bazelrc build --compilation_mode=opt --dynamic_mode=off --config=luajit ${{ matrix.cfg.config }} //dmlab2d:dmlab2d_wheel
74
75
76
+ - name : Get built wheel name
77
+ working-directory : bazel-bin/dmlab2d
78
+ run : |
79
+ WHEEL_NAME="$(ls *.whl)"
80
+ echo WHEEL_NAME="${WHEEL_NAME}" >> "${GITHUB_ENV}"
81
+
82
+ - name : Check wheel contents
83
+ run : check-wheel-contents bazel-bin/dmlab2d/${{ env.WHEEL_NAME }}
84
+
85
+ - name : Test wheel
86
+ if : (!contains(env.WHEEL_NAME, 'arm64'))
87
+ run : |
88
+ pip install bazel-bin/dmlab2d/${{ env.WHEEL_NAME }}
89
+ python -I - <<'____HERE'
90
+ import dmlab2d
91
+ import dmlab2d.runfiles_helper
92
+
93
+ lab = dmlab2d.Lab2d(dmlab2d.runfiles_helper.find(), {"levelName": "chase_eat"})
94
+ env = dmlab2d.Environment(lab, ["WORLD.RGB"])
95
+ env.step({})
96
+ ____HERE
97
+
75
98
- name : Upload Release Asset
76
99
uses : actions/upload-release-asset@v1
77
100
env :
78
101
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
79
102
with :
80
103
upload_url : ${{ needs.create-release.outputs.upload-url }}
81
- asset_path : bazel-bin/dmlab2d/dmlab2d-1.0- ${{ matrix.py.interp }}-${{ matrix.py.abi }}-${{ matrix.cfg.platform }}.whl
82
- asset_name : dmlab2d-1.0- ${{ matrix.py.interp }}-${{ matrix.py.abi }}-${{ matrix.cfg.platform }}.whl
104
+ asset_path : bazel-bin/dmlab2d/${{ env.WHEEL_NAME }}
105
+ asset_name : ${{ env.WHEEL_NAME }}
83
106
asset_content_type : application/zip
0 commit comments