Repository navigation
125 lines (108 loc) · 4.07 KB
/
Copy pathci.yml
File metadata and controls
125 lines (108 loc) · 4.07 KB
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
name: CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
ci:
name: CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang cmake ninja-build wget lsb-release software-properties-common gnupg
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 23
sudo apt-get install -y clang-23 lld-23 llvm-23-dev libmlir-23-dev mlir-23-tools
wget https://github.com/sharkdp/hyperfine/releases/download/v1.20.0/hyperfine_1.20.0_amd64.deb
sudo dpkg -i hyperfine_1.20.0_amd64.deb
uv sync
- name: Build Lython
run: |
cmake -B build -S . -G Ninja \
-DCMAKE_C_COMPILER=clang-23 \
-DCMAKE_CXX_COMPILER=clang++-23 \
-DLLVM_DIR=/usr/lib/llvm-23/lib/cmake/llvm \
-DMLIR_DIR=/usr/lib/llvm-23/lib/cmake/mlir \
-DLYTHON_BUILD_TESTS=ON
cmake --build build -j$(nproc)
- name: Test
env:
LLVM_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-22
run: ctest --test-dir build -j"$(nproc)" --output-on-failure
- name: Benchmarks
run: |
./build/bin/lyc examples/fib.py -o fib_aot
./build/bin/lyc examples/fib_prim.py -o fib_prim_aot
hyperfine -w 1 -r 5 "python3 examples/fib.py" "./build/bin/lyc jit examples/fib.py" "./fib_aot" "./fib_prim_aot"
fuzz-smoke:
name: Fuzz smoke
runs-on: ubuntu-latest
env:
# Leak checking off: harnesses intentionally leak one-time registries,
# and build-time codegen tools also run ASan-instrumented. Container
# overflow / user poisoning off: system LLVM/MLIR dylibs are
# uninstrumented, while LLVM inline allocators compiled into our objects
# poison memory the dylib then touches (use-after-poison false
# positives).
ASAN_OPTIONS: detect_leaks=0:detect_container_overflow=0:allow_user_poisoning=0
LLVM_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-22
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build wget lsb-release software-properties-common gnupg
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 23
sudo apt-get install -y clang-23 lld-23 llvm-23-dev libmlir-23-dev mlir-23-tools
- name: Build fuzzers
run: |
cmake -B build-fuzz -S . -G Ninja \
-DCMAKE_C_COMPILER=clang-23 \
-DCMAKE_CXX_COMPILER=clang++-23 \
-DLLVM_DIR=/usr/lib/llvm-23/lib/cmake/llvm \
-DMLIR_DIR=/usr/lib/llvm-23/lib/cmake/mlir \
-DLYTHON_ENABLE_FUZZERS=ON \
-DLYTHON_BUILD_TESTS=OFF \
-DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build-fuzz -j$(nproc) --target fuzz_parser fuzz_emitter fuzz_pipeline
- name: Corpus regression
run: ctest --test-dir build-fuzz -j"$(nproc)" --output-on-failure
- name: Short fuzz
continue-on-error: true
run: |
fuzz_one() {
./build-fuzz/bin/$1 -max_total_time=$2 -timeout=10 \
-rss_limit_mb=4096 -dict=fuzz/dictionaries/python.dict \
"fuzz/corpora/$1" tests/golden/cases
}
fuzz_one fuzz_parser 30
fuzz_one fuzz_emitter 150
fuzz_one fuzz_pipeline 240
- name: Upload crash artifacts
# short fuzz は continue-on-error なので failure() では拾えない
if: always()
uses: actions/upload-artifact@v4
with:
name: fuzz-artifacts
path: |
crash-*
leak-*
timeout-*
oom-*
if-no-files-found: ignore