-
-
Notifications
You must be signed in to change notification settings - Fork 5
138 lines (118 loc) · 3.74 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
name: build
on:
push:
workflow_dispatch:
workflow_call:
inputs:
external_call:
description: 'To distinguish workflow_call from regular push'
type: boolean
required: false
default: true
rizin_ref:
required: false
type: string
default: 'dev'
jobs:
pypa-wheels:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-2019, macos-14]
steps:
- name: Install SWIG with Homebrew
if: matrix.os == 'macos-14' && matrix.enabled
run: brew install swig
- name: Checkout rz-bindgen
uses: actions/checkout@v4
# runned only from workflow_call
- name: Checkout rizin
if: ${{ inputs.external_call }}
uses: actions/checkout@v4
with:
repository: rizinorg/rizin
path: rizin
ref: ${{ inputs.rizin_ref }}
- name: Checkout rizin (stable)
if: ${{ !inputs.external_call && ((github.ref_name == 'stable') || (github.base_ref == 'stable')) }}
uses: actions/checkout@v4
with:
repository: rizinorg/rizin
path: rizin
ref: stable
- name: Checkout rizin (dev)
if: ${{ !inputs.external_call && ((github.ref_name != 'stable') && (github.base_ref != 'stable')) }}
uses: actions/checkout@v4
with:
repository: rizinorg/rizin
path: rizin
ref: dev
- name: Build rz-bindgen
uses: pypa/[email protected]
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: sdist-${{ matrix.os }}
path: dist/*.tar.gz
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: wheelhouse/*.whl
ubuntu-default-llvm:
runs-on: ubuntu-22.04
steps:
- name: Checkout rz-bindgen
uses: actions/checkout@v4
with:
path: rz-bindgen
# runned only from workflow_call
- name: Checkout rizin
if: ${{ inputs.external_call }}
uses: actions/checkout@v4
with:
repository: rizinorg/rizin
path: rizin
ref: ${{ inputs.rizin_ref }}
- name: Checkout rizin (stable)
if: ${{ !inputs.external_call && ((github.ref_name == 'stable') || (github.base_ref == 'stable')) }}
uses: actions/checkout@v4
with:
repository: rizinorg/rizin
path: rizin
ref: stable
- name: Checkout rizin (dev)
if: ${{ !inputs.external_call && ((github.ref_name != 'stable') && (github.base_ref != 'stable')) }}
uses: actions/checkout@v4
with:
repository: rizinorg/rizin
path: rizin
ref: dev
- name: Install dependencies
run: |
sudo apt update
sudo apt-get --assume-yes install cmake swig pkg-config clang libclang-dev llvm wget unzip python3-wheel python3-setuptools build-essential python3-pip
pygt311=$(python3 -c 'import sys; print(0) if sys.version_info.minor > 11 else print(1)' 2>&1)
if [[ $pygt311 == '0' ]]; then
sudo pip3 --break-system-packages install meson ninja
else
sudo pip3 install meson ninja
fi
- name: Install rizin
run: |
export PATH=$PATH:/usr/local/bin
meson setup --prefix=/usr --buildtype=release build && ninja -C build && sudo ninja -C build install
working-directory: rizin
- name: Build rz-bindgen
run: |
meson setup --prefix=/usr -Dplugin=enabled build
meson compile -C build
sudo meson install -C build
working-directory: rz-bindgen
- name: Test python lang plugin
run: rizin -qc "Ll" | grep "Python SWIG"
- name: Test rizin.py
run: |
echo "import rizin" > testimport.py
python3 testimport.py