8000 enable x86 testing on Windows in CI · pythonnet/pythonnet@cf91f1c · GitHub
[go: up one dir, main page]

Skip to content

Commit cf91f1c

Browse files
committed
enable x86 testing on Windows in CI
1 parent 5af1961 commit cf91f1c

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ jobs:
1717
matrix:
1818
os: [windows, ubuntu, macos]
1919
python: ["3.6", "3.7", "3.8", "3.9", "3.10"]
20-
platform: [x64]
20+
platform: [x64, x86]
21+
exclude:
22+
- os: ubuntu
23+
platform: x86
24+
- os: macos
25+
platform: x86
2126

2227
steps:
2328
- name: Set Environment on macOS
@@ -67,6 +72,7 @@ jobs:
6772
run: pytest --runtime mono
6873

6974
- name: Python Tests (.NET Core)
75+
if: ${{ matrix.platform == 'x64' }}
7076
run: pytest --runtime netcore
7177

7278
- name: Python Tests (.NET Framework)

src/runtime/Native/NativeTypeSpec.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ struct NativeTypeSpec : IDisposable
1010
public readonly StrPtr Name;
1111
public readonly int BasicSize;
1212
public readonly int ItemSize;
13-
public readonly IntPtr Flags;
13+
public readonly int Flags;
1414
public IntPtr Slots;
1515

1616
public NativeTypeSpec(TypeSpec spec)
@@ -20,7 +20,7 @@ public NativeTypeSpec(TypeSpec spec)
2020
this.Name = new StrPtr(spec.Name, Encoding.UTF8);
2121
this.BasicSize = spec.BasicSize;
2222
this.ItemSize = spec.ItemSize;
23-
this.Flags = new IntPtr((long)spec.Flags);
23+
this.Flags = (int)spec.Flags;
2424

2525
unsafe
2626
{

tests/conftest.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ def pytest_configure(config):
8686
else:
8787
domain_tests_dir = os.path.join(os.path.dirname(__file__), "domain_tests")
8888
bin_path = os.path.join(domain_tests_dir, "bin")
89-
check_call(["dotnet", "build", domain_tests_dir, "-o", bin_path])
89+
build_cmd = ["dotnet", "build", domain_tests_dir, "-o", bin_path]
90+
is_64bits = sys.maxsize > 2**32
91+
if not is_64bits:
92+
build_cmd += ["/p:Prefer32Bit=True"]
93+
check_call(build_cmd)
9094

9195

9296

0 commit comments

Comments
 (0)
0