-
Notifications
You must be signed in to change notification settings - Fork 397
172 lines (165 loc) · 5.3 KB
/
build.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
check_generated_files:
name: "Check if generated files are up to date"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up dependencies
run: |
sudo apt-get update
sudo apt-get install -qy npm git
- name: Check if files are up to date
run: make build-js
- name: Check for changes
run: |
git add -u
changes=$(git status --porcelain)
# Check for changes in regenerated files
if test -n "$changes"; then
echo "Generated files not up to date."
echo "$changes"
echo ""
git diff --staged || true
exit 1
fi
test_with_coverage:
name: "Test with coverage"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Set up dependencies
run: |
sudo apt-get update
sudo apt-get install -qy libdebuginfod-dev libunwind-dev liblz4-dev pkg-config npm gdb lldb lcov
- name: Create virtual environment
run: |
python3 -m venv venv
- name: Install Python dependencies
run: |
./venv/bin/python -m pip install --upgrade pip
- name: Disable ptrace security restrictions
run: |
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
- name: Run coverage
env:
CYTHON_TEST_MACROS: 1
PYTHON: ./venv/bin/python
run: |
make dev-install pycoverage
test_in_alpine:
name: "Test in Alpine Linux"
runs-on: ubuntu-latest
container:
image: alpine
options: --cap-add=SYS_PTRACE
env:
# Coverage is kind of broken in Alpine
SKIP_COVERAGE_HTML: 1
steps:
- uses: actions/checkout@v4
- name: Set up dependencies
run: |
apk add --update build-base libunwind-dev lz4-dev musl-dev python3-dev python3-dbg gdb lldb git bash perl perl-datetime build-base perl-app-cpanminus
cpanm Date::Parse
cpanm Capture::Tiny
# Build elfutils
cd /
apk add --update argp-standalone bison bsd-compat-headers bzip2-dev curl curl-dev flex-dev libtool linux-headers musl-fts-dev musl-libintl musl-obstack-dev xz-dev zlib-dev zstd-dev
VERS=0.191
curl https://sourceware.org/elfutils/ftp/$VERS/elfutils-$VERS.tar.bz2 > ./elfutils.tar.bz2
tar -xf elfutils.tar.bz2
cd elfutils-$VERS
CFLAGS='-Wno-error -DFNM_EXTMATCH=0 -g -O3' CXXFLAGS='-Wno-error -DFNM_EXTMATCH=0 -g -O3' ./configure --enable-libdebuginfod --disable-debuginfod --disable-nls --with-zstd
make install
- name: Clone lcov repository
run: |
git clone https://github.com/linux-test-project/lcov.git
ls -al
- name: Build and install lcov
run: |
cd lcov
make install
- name: Create virtual environment
run: |
python3 -m venv /venv
- name: Install Python dependencies
run: |
/venv/bin/python -m pip install --upgrade pip
- name: Run coverage
env:
CYTHON_TEST_MACROS: 1
PYTHON: /venv/bin/python
GENHTMLOPTS: "--ignore-errors inconsistent"
run: |
make dev-install pycoverage
lint_and_docs:
name: "Lint and Docs"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 16
- name: Symlink node as nodejs
run: ln -sf "$(which node)" "$(which node)js"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Set up dependencies
run: |
sudo apt-get update
sudo apt-get install -qy clang-format npm libdebuginfod-dev libunwind-dev liblz4-dev pkg-config
- name: Install Python dependencies
run: |
python3 -m pip install -r requirements-extra.txt
- name: Install Package
run: |
python3 -m pip install -e .
- name: Lint sources
run: |
make lint
- name: Build docs
run: |
towncrier build --version 99.99 --name memray --keep
make docs
valgrind:
name: "Valgrind & Helgrind"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Set up dependencies
run: |
sudo apt-get update
sudo apt-get install -qy libdebuginfod-dev libunwind-dev liblz4-dev pkg-config npm valgrind
- name: Install Python dependencies and package
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-test.txt
python3 -m pip install -e .
env:
MEMRAY_MINIMIZE_INLINING: 1
- name: Run Valgrind
run: make valgrind
- name: Run Helgrind
run: make helgrind