-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (82 loc) · 3.95 KB
/
Copy pathci.yml
File metadata and controls
92 lines (82 loc) · 3.95 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
name: CI
on:
push:
branches: [master, main]
pull_request:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
# PR-only: don't cancel an in-flight push validation on master.
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build-test:
name: ${{ matrix.os }}/llvm${{ matrix.llvm }}/py${{ matrix.py }}/c++${{ matrix.cxx }}${{ matrix.vg && '/vg' || '' }}${{ matrix.flavor == 'cling' && '/cling' || '' }}
strategy:
fail-fast: false
# Mirrors CppInterOp's cppyy PR cells: clang-repl on the same OS/arch/LLVM
# /valgrind combos at Python 3.14, plus a cling cell. Breadth (3.12/3.13,
# C++17, LLVM 20, arm) lives in nightly.
matrix:
include:
- { os: ubuntu-24.04, llvm: '21', flavor: system, py: '3.14', cxx: '20', vg: true }
- { os: ubuntu-24.04, llvm: '22', flavor: '', py: '3.14', cxx: '20' }
- { os: macos-26, llvm: '21', flavor: system, py: '3.14', cxx: '20' }
- { os: macos-26-intel, llvm: '21', flavor: system, py: '3.14', cxx: '20' }
# cling backend, against the cached llvm-root (cling-llvm20) recipe cell.
- { os: ubuntu-24.04, llvm: '20', flavor: cling, flavor_version: cling-llvm20, py: '3.14', cxx: '20' }
uses: compiler-research/ci-workflows/.github/workflows/cppjit.yml@main
with:
# CppInterOp is pinned in CppJIT's cmake to a commit compatible
# with the current forks.
cppjit-repo: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
cppjit-ref: ${{ github.event.pull_request.head.sha || github.sha }}
os: ${{ matrix.os }}
llvm-version: ${{ matrix.llvm }}
llvm-flavor: ${{ matrix.flavor }}
llvm-flavor-version: ${{ matrix.flavor_version || '' }}
python-version: ${{ matrix.py }}
cxx-standard: ${{ matrix.cxx }}
valgrind: ${{ matrix.vg || false }}
run-xfail-crashing-tests: true
report:
if: ${{ always() && github.event_name == 'pull_request' }}
needs: build-test
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: result-*
- uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const marker = '<!-- cppjit-ci -->';
const rows = fs.readdirSync('.').filter(d => d.startsWith('result-')).sort().map(d => {
const cfg = d.replace('result-', '');
const file = `${d}/pytest-summary.txt`;
const lines = fs.existsSync(file) ? fs.readFileSync(file, 'utf8').trim().split('\n') : [];
const result = lines.length ? lines.at(-1) : 'no output';
return `| ${cfg} | \`${result}\` |`;
});
const body = [marker, '## Test Results', '| Configuration | Result |', '|---|---|', ...rows].join('\n');
// Run summary works even with a read-only token (fork PRs).
await core.summary.addRaw(body).write();
// PR comment needs pull-requests:write, downgraded to read-only on
// fork PRs — don't fail the job when the write errors out.
try {
const { data: comments } = await github.rest.issues.listComments({
...context.repo, issue_number: context.issue.number,
});
const existing = comments.find(c => c.body.startsWith(marker));
if (existing) {
await github.rest.issues.updateComment({ ...context.repo, comment_id: existing.id, body });
} else {
await github.rest.issues.createComment({ ...context.repo, issue_number: context.issue.number, body });
}
} catch (e) {
core.warning(`Could not post PR comment (likely a fork PR with a read-only token): ${e.message}`);
}