-
Notifications
You must be signed in to change notification settings - Fork 32
119 lines (103 loc) · 3.09 KB
/
ci-ffi-python.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
name: Python Package
on:
push:
branches:
pull_request:
branches: [ main ]
jobs:
linux-build:
name: Linux - amd64
runs-on: ubuntu-latest # TODO try using grafana runners
steps:
- uses: actions/checkout@v4
- name: Build in Docker
run: make wheel/linux/amd64
- uses: actions/upload-artifact@v4
with:
name: "linux.whl"
path: pyroscope_ffi/python/dist/*
linux-test:
strategy:
fail-fast: false
matrix:
PYTHON_VERSION: [ '3.9', '3.10', '3.11', '3.12', '3.13']
needs: [ 'linux-build' ]
name: Linux Test
runs-on: ubuntu-latest
env:
PYROSCOPE_RUN_ID: ${{ github.run_id }}
PYROSCOPE_ARCH: x86-64-linux
PYROSCOPE_API_TOKEN: ${{ secrets.PYROSCOPE_API_TOKEN }}
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.PYTHON_VERSION }}
architecture: x64
- uses: actions/download-artifact@v4
with:
name: "linux.whl"
path: "${{github.workspace}}/python"
- run: "cd ${{ github.workspace }}/python && ls -l"
- run: "cd ${{ github.workspace }}/python && pip install *.whl"
- uses: actions/checkout@v4
- run: docker run -d -p4040:4040 grafana/pyroscope
- run: python pyroscope_ffi/python/scripts/tests/test.py
linux-arm-build:
name: Linux - arm64
runs-on: github-hosted-ubuntu-arm64
steps:
- uses: AutoModality/action-clean@v1
- uses: actions/checkout@v4
- name: Build in Docker
run: make wheel/linux/arm64
- uses: actions/upload-artifact@v4
with:
name: "linux-arm.whl"
path: pyroscope_ffi/python/dist/*
sdist-build:
name: sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Upgrade pip
run: |
python -m pip install --upgrade pip pipenv wheel
- name: Build sdist
run: python setup.py sdist
working-directory: pyroscope_ffi/python
- uses: actions/upload-artifact@v4
with:
name: "sdist.whl"
path: pyroscope_ffi/python/dist/*
macos-build:
strategy:
fail-fast: false
matrix:
include:
- macos-version: "14"
target: x86_64-apple-darwin
mk-arch: amd64
- macos-version: "14"
target: aarch64-apple-darwin
mk-arch: arm64
name: macOS - ${{ matrix.target }}
runs-on: macos-${{ matrix.macos-version }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: 1.82.0
targets: ${{ matrix.target }}
- uses: actions/setup-python@v5
with:
python-version: 3.11
- run: make wheel/mac/${{ matrix.mk-arch }}
- uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}-python-${{ matrix.target }}
path: pyroscope_ffi/python/dist/*