-
Notifications
You must be signed in to change notification settings - Fork 0
145 lines (129 loc) · 4.5 KB
/
lua-valgrind-full.yml
File metadata and controls
145 lines (129 loc) · 4.5 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Lua Full Valgrind Memcheck
on:
schedule:
- cron: "47 4 * * 0"
workflow_dispatch:
permissions:
contents: read
issues: write
env:
CARGO_TERM_COLOR: always
jobs:
lua-valgrind-full:
name: Full Lua valgrind memcheck
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
persist-credentials: false
- name: Install Rust (stable)
run: |
rustup toolchain install stable --profile minimal --no-self-update
rustup default stable
- name: Cache cargo registry & target
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: lua-valgrind-full-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Cargo.toml', 'Cargo.lock') }}
restore-keys: |
lua-valgrind-full-${{ runner.os }}-${{ runner.arch }}-
- name: Build cdylib (release)
run: cargo build --release
- name: Install LuaJIT
uses: ./.github/actions/setup-lua
with:
lua-version: "luajit-2.1.0-beta3"
install-luarocks: "false"
- name: Install Lua dependencies
run: .github/scripts/install-lua-test-deps.sh
- name: Install valgrind
run: sudo apt-get install -y valgrind
- name: Resolve LuaJIT executable
id: luajit
run: .github/scripts/resolve-luajit.sh
- name: Run full Lua suite under valgrind
env:
LUAJIT_BIN: ${{ steps.luajit.outputs.path }}
LUA_INIT: if jit then jit.off() end
run: |
LD_LIBRARY_PATH="$PWD/target/release" \
valgrind \
--trace-children=yes \
--error-exitcode=1 \
--leak-check=full \
--show-leak-kinds=definite,indirect,possible \
--errors-for-leak-kinds=definite,indirect,possible \
--num-callers=24 \
--suppressions=valgrind.supp \
busted --lua="$LUAJIT_BIN" tests/lua \
--lpath='./lua/?.lua'
- name: Open or update failure issue
if: failure() && github.event_name == 'schedule'
uses: actions/github-script@v7
with:
script: |
const title = 'Scheduled full Lua Valgrind memcheck failed';
const labels = [
{ name: 'ci', color: '0e8a16', description: 'Continuous integration failure' },
{ name: 'valgrind', color: '5319e7', description: 'Valgrind memory-check failure' },
];
const { owner, repo } = context.repo;
const runUrl = `${context.serverUrl}/${owner}/${repo}/actions/runs/${context.runId}`;
const sha = context.sha;
const body = [
'The scheduled full Lua Valgrind memcheck failed.',
'',
`- Workflow: ${context.workflow}`,
`- Run: ${runUrl}`,
`- Commit: ${sha}`,
'',
'Please inspect the run log, reproduce locally if needed, and close this issue once the scheduled workflow is green again.',
].join('\n');
for (const label of labels) {
try {
await github.rest.issues.getLabel({
owner,
repo,
name: label.name,
});
} catch (error) {
if (error.status !== 404) {
throw error;
}
await github.rest.issues.createLabel({
owner,
repo,
name: label.name,
color: label.color,
description: label.description,
});
}
}
const { data: openIssues } = await github.rest.issues.listForRepo({
owner,
repo,
state: 'open',
per_page: 100,
});
const existing = openIssues.find((issue) => issue.title === title && !issue.pull_request);
if (existing) {
await github.rest.issues.createComment({
owner,
repo,
issue_number: existing.number,
body,
});
} else {
await github.rest.issues.create({
owner,
repo,
title,
body,
labels: labels.map((label) => label.name),
});
}