-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (65 loc) · 1.96 KB
/
test.yml
File metadata and controls
81 lines (65 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: GIL Talk Demo
on: push
permissions:
contents: read
jobs:
build:
strategy:
matrix:
version: ["3.9", "3.10", "3.11", "3.12"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "${{ matrix.version }}"
allow-prereleases: true
- name: Check Python version
run: python -VV
- name: Install dependencies
run: pip install setuptools
- name: Build C extension
run: |
python python_c_extension/setup.py build
cp -r build/*/* python_c_extension
- name: Run script in single and multi-thread mode
run: python python_c_extension/c_extension_gil.py
env:
PYTHONPATH: "."
PYTHON_GIL: 0
- name: Run Tests
run: python -m unittest discover tests/ -vvv
env:
PYTHON_GIL: 0
build-freethreaded:
strategy:
matrix:
version: ["py313", "py314"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.8.0
with:
manifest-path: pixi.toml
environments: ${{ matrix.version }}
- name: Check Python version
run: pixi run -e ${{ matrix.version }} python -VV
- name: Check GIL is disabled
run: pixi run -e ${{ matrix.version }} python -c "import sys; print('GIL enabled:', sys._is_gil_enabled())"
env:
PYTHON_GIL: 0
- name: Build C extension
run: |
pixi run -e ${{ matrix.version }} python python_c_extension/setup.py build
cp -r build/*/* python_c_extension
- name: Run script in single and multi-thread mode
run: pixi run -e ${{ matrix.version }} python python_c_extension/c_extension_gil.py
env:
PYTHONPATH: "."
PYTHON_GIL: 0
- name: Run Tests
run: pixi run -e ${{ matrix.version }} python -m unittest discover tests/ -vvv
env:
PYTHON_GIL: 0