forked from scoder/lupa
-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (129 loc) · 4.71 KB
/
ci.yml
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Continuous Integration
on: [push, pull_request]
jobs:
build:
strategy:
# Allows for matrix sub-jobs to fail without canceling the rest
fail-fast: false
matrix:
os:
- windows-2019
- ubuntu-20.04
- macos-12
- macos-latest
python-version:
- "2.7"
- "3.13"
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
- "3.7"
- "3.6"
- "pypy-2.7"
- "pypy-3.7"
- "pypy-3.8"
- "pypy-3.9"
- "pypy-3.10"
lua-version:
- "bundle"
- "lua5.3"
- "lua5.2"
- "luajit-5.1"
exclude:
- os: windows-2019
python-version: "2.7"
- os: windows-2019
python-version: pypy-2.7
- os: windows-2019
lua-version: lua5.2
- os: windows-2019
lua-version: lua5.3
- os: windows-2019
lua-version: lua5.4
- os: windows-2019
lua-version: luajit-5.1
- os: macos-12
python-version: "2.7"
- os: macos-latest
python-version: "2.7"
- os: macos-latest
python-version: "3.6"
- os: macos-latest
python-version: "3.7"
- os: macos-latest
python-version: pypy-3.7
- os: macos-12
lua-version: lua5.2
- os: macos-12
lua-version: lua5.3
- os: macos-12
lua-version: lua5.4
- os: macos-12
lua-version: luajit-5.1
- os: macos-latest
lua-version: lua5.2
- os: macos-latest
lua-version: lua5.3
- os: macos-latest
lua-version: lua5.4
- os: macos-latest
lua-version: luajit-5.1
runs-on: ${{ matrix.os }}
env:
CFLAGS_LTO: ${{ contains(matrix.lua-version, 'bundle') && (contains(matrix.os, 'windows') && '/LTCG' || '-flto') || '' }}
CFLAGS: ${{ contains(matrix.os, 'windows') && '/O2' || '-O2 -fPIC' }} -g
MACOSX_DEPLOYMENT_TARGET: "11.0"
LUPA_WITH_LUA_DLOPEN: ${{ startsWith(matrix.os, 'windows') && 'false' || 'true' }}
steps:
- uses: actions/checkout@v4
- name: Check out recursively
run: git submodule update --init --recursive
- name: Set up Python ${{ matrix.python-version }}
if: startsWith(matrix.python-version, '3.') || startsWith(matrix.python-version, 'pypy') || !startsWith(matrix.os, 'ubuntu')
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up Python2 (Linux)
if: matrix.python-version == '2.7' && startsWith(matrix.os, 'ubuntu')
run: |
sudo ln -fs python2 /usr/bin/python
sudo apt-get update
sudo apt-get install python-setuptools python2.7 python2.7-dev
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
sudo python2 get-pip.py
ls -l /usr/bin/pip* /usr/local/bin/pip*
which pip
- name: Set up Python packages
run: |
python -m pip install -U ${{ startsWith(matrix.python-version, '2.7') && '"pip<21" "setuptools<45"' || 'pip setuptools' }}
python -m pip install -U wheel tox virtualenv -r requirements.txt
- name: Set up Lua ${{ matrix.lua-version }}
if: contains(matrix.os, 'ubuntu') && matrix.lua-version != 'bundle'
run: sudo apt-get install lib${{ matrix.lua-version }}-dev
- name: Setup Visual Studio
if: contains(matrix.os, 'windows')
uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x64
- name: Build wheel
run: python setup.py sdist ${{ contains(matrix.python-version, '3.') && 'build_ext -j6' || '' }} bdist_wheel
env:
SETUP_OPTIONS: ${{ !contains(matrix.lua-version, 'luajit') && (contains(matrix.lua-version, 'bundle') && '--use-bundle' || '--no-luajit') || '' }}
CFLAGS: ${{ env.CFLAGS }} ${{ env.CFLAGS_LTO }}
LDFLAGS: ${{ env.CFLAGS_LTO }}
- name: Run tests
run: python setup.py test
continue-on-error: ${{ contains(matrix.python-version, 'pypy') }}
env:
SETUP_OPTIONS: ${{ !contains(matrix.lua-version, 'luajit') && (contains(matrix.lua-version, 'bundle') && '--use-bundle' || '--no-luajit') || '' }}
CFLAGS: ${{ env.CFLAGS }} ${{ env.CFLAGS_LTO }}
LDFLAGS: ${{ env.CFLAGS_LTO }}
- name: Upload wheels
if: matrix.lua-version == 'bundle' && matrix.os == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.python-version }}
path: dist/*.whl
if-no-files-found: ignore