FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
runtime-data/.github/workflows/generate-python.yml at main · parca-dev/runtime-data · GitHub
parca-dev
/
runtime-data
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
4
Code
Issues
2
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
runtime-data
/
.github
/
workflows
/
generate-python.yml
Copy path
View runs
More file actions
More file actions
Latest commit
History
History
History
168 lines (141 loc) · 5.87 KB
Breadcrumbs
runtime-data
/
.github
/
workflows
/
generate-python.yml
Copy path
File metadata and controls
168 lines (141 loc) · 5.87 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name
:
Generate Python
on
:
workflow_call
:
push
:
branches
:
-
main
-
release
paths
:
-
"
.github/workflows/generate-python.yml
"
-
"
pkg/python/**
"
concurrency
:
group
:
${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress
:
true
jobs
:
generate
:
runs-on
:
ubuntu-latest
timeout-minutes
:
20
strategy
:
fail-fast
:
false
matrix
:
python-version
:
[
3.8.0, 3.8.1, 3.8.2, 3.8.3, 3.8.4, 3.8.5, 3.8.6, 3.8.7, 3.8.8, 3.8.9, 3.8.10, 3.8.11, 3.8.12, 3.8.13, 3.8.14, 3.8.15, 3.8.16, 3.8.17, 3.8.18, 3.8.19,
3.9.0, 3.9.1, 3.9.2, 3.9.3, 3.9.4, 3.9.5, 3.9.6, 3.9.7, 3.9.8, 3.9.9, 3.9.10, 3.9.11, 3.9.12, 3.9.13, 3.9.14, 3.9.15, 3.9.16, 3.9.17, 3.9.18, 3.9.19,
3.10.0, 3.10.1, 3.10.2, 3.10.3, 3.10.4, 3.10.5, 3.10.6, 3.10.7, 3.10.8, 3.10.9, 3.10.10, 3.10.11, 3.10.12, 3.10.13, 3.10.14,
3.11.0, 3.11.1, 3.11.2, 3.11.3, 3.11.4, 3.11.5, 3.11.6, 3.11.7, 3.11.8, 3.11.9,
3.12.0, 3.12.1, 3.12.2, 3.12.3,
3.13.0a4
]
arch
:
[amd64, arm64]
steps
:
-
name
:
Check out the code
uses
:
actions/checkout@v4
-
name
:
Install devbox
uses
:
jetpack-io/devbox-install-action@v0.8.0
with
:
enable-cache
:
true
-
name
:
Setup devbox
run
:
devbox run -- echo "done!"
-
name
:
Load devbox shellenv
uses
:
HatsuneMiku3939/direnv-action@v1
with
:
direnvVersion
:
2.32.3
-
name
:
Set up Go tool cache
uses
:
actions/cache@v4
with
:
path
:
~/.devbox/go
key
:
devbox-go-tools.cache-${{ runner.os }}-${{ runner.arch }}
-
name
:
Build
run
:
make build
-
name
:
Set up QEMU
uses
:
docker/setup-qemu-action@v3
with
:
platforms
:
linux/amd64,linux/arm64
-
name
:
Set up cache for downloaded files
uses
:
actions/cache@v4
with
:
path
:
python-binaries
key
:
python-downloaded-${{ runner.os }}-${{ matrix.arch }}
restore-keys
:
|
python-downloaded-${{ runner.os }}-${{ matrix.arch }}-${{ matrix.python-version }}
-
name
:
Generate Python Offsets for ${{ matrix.python-version }} on ${{ matrix.arch }}
run
:
|
export python_version="${{ matrix.python-version }}"
if ! ls python-binaries/${{ matrix.arch }}/${{ matrix.python-version }}/libpython"${python_version%.*}"*.so.1.0 1> /dev/null 2>&1; then
mkdir -p python-binaries/${{ matrix.arch }}/${{ matrix.python-version }}
docker run --rm --platform "linux/${{ matrix.arch }}" -v "${PWD}"/python-binaries/${{ matrix.arch }}/${{ matrix.python-version }}:/tmp -w /tmp docker.io/library/python:${{ matrix.python-version }} bash -c 'cp /usr/local/lib/libpython"${python_version%.*}"*.so.1.0 /tmp' || exit 0 # (some containers of python do not have arm64 version)
fi
mkdir -p offsets-python/${{ matrix.arch }}
./structlayout -r python -v ${{ matrix.python-version }} -o offsets-python/${{ matrix.arch }} python-binaries/${{ matrix.arch }}/${{ matrix.python-version }}/libpython"${python_version%.*}"*.so.1.0
git add offsets-python
cp $(git diff --name-only --staged | xargs) offsets-python || echo "No new or modified files - offsets
are up to date"
-
name
:
Upload Offsets
uses
:
actions/upload-artifact@v4
with
:
if-no-files-found
:
ignore
name
:
python-${{ matrix.arch }}-${{ matrix.python-version }}
path
:
offsets-python
retention-days
:
1
merge-and-create-branch
:
runs-on
:
ubuntu-latest
needs
:
generate
permissions
:
contents
:
write
pull-requests
:
write
steps
:
-
name
:
Check out the code
uses
:
actions/checkout@v4
-
name
:
Install devbox
uses
:
jetpack-io/devbox-install-action@v0.8.0
with
:
enable-cache
:
true
-
name
:
Setup devbox
run
:
devbox run -- echo "done!"
-
name
:
Load devbox shellenv
uses
:
HatsuneMiku3939/direnv-action@v1
with
:
direnvVersion
:
2.32.3
-
name
:
Set up Go tool cache
uses
:
actions/cache@v4
with
:
path
:
~/.devbox/go
key
:
devbox-go-tools.cache-${{ runner.os }}-${{ runner.arch }}
-
name
:
Build
run
:
make build
-
name
:
Download all artifacts
uses
:
actions/download-artifact@v4
with
:
path
:
offsets-python
merge-multiple
:
true
-
name
:
Print the layout files
run
:
tree offsets-python
-
name
:
Merge the layout files
run
:
|
target_archs=(
amd64
arm64
)
find pkg/python/layout/*/ -name "3.[8-9].*.yaml" -delete -o -name "3.1?.*.yaml" -delete
find pkg/python/initialstate/*/ -name "3.[8-9].*.yaml" -delete -o -name "3.1?.*.yaml" -delete
for arch in "${target_archs[@]}"; do
mkdir -p pkg/python/layout/"${arch}"
./mergelayout -o pkg/python/layout/"${arch}" offsets-python/"${arch}"/layout/python_*.yaml
mkdir -p pkg/python/initialstate"/${arch}"
./mergelayout -o pkg/python/initialstate/"${arch}" offsets-python/"${arch}"/initialstate/python_*.yaml
done
#
If there are no changes (i.e. no diff exists with the checked-out base branch),
#
no pull request will be created and the action exits silently.
-
name
:
Create a pull-request
if
:
github.event_name != 'pull_request'
uses
:
peter-evans/create-pull-request@v6
with
:
token
:
${{ secrets.GITHUB_TOKEN }}
commit-message
:
"
chore: update python layouts
"
title
:
"
chore: Update Python layouts
"
branch
:
update-python-offsets-${{ github.run_number }}
add-paths
:
pkg/python/layout, pkg/python/initialstate
base
:
main
labels
:
chore
draft
:
false
delete-branch
:
true
Back
|
FazBrowse Home
|
New Git URL