-
Notifications
You must be signed in to change notification settings - Fork 61
152 lines (133 loc) · 5.3 KB
/
test_llvm_compat.yml
File metadata and controls
152 lines (133 loc) · 5.3 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
146
147
148
149
150
151
152
name: LLVM Compatibility
# apt.llvm.org rebuilds packages from the HEAD of each release branch twice
# daily, so installing a versioned package always tests against the latest
# tip of that branch
#
# Version schedule:
# Branch cut in Jan/Jul → next added to matrix (release/<ver>.x now exists)
# Release in Feb/Aug → both latest and next still run
# Transition in Mar/Sep → latest bumps, next drops until next branch cut
#
# Mar 2026 → latest=22 Sep 2026 → latest=23
# Mar 2027 → latest=24 Sep 2027 → latest=25
on:
schedule:
- cron: "0 0 * * 0" # weekly, Sundays at midnight UTC
workflow_dispatch:
concurrency:
group: llvm-compatibility
cancel-in-progress: true
permissions:
contents: read
checks: write # required by dorny/test-reporter to post results
jobs:
# ── Build the test matrix ────────────────────────────────────────────────
compute-versions:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.versions.outputs.matrix }}
steps:
- name: Compute LLVM versions
id: versions
run: |
python3 - << 'PYEOF'
import datetime, subprocess, json, os
now = datetime.datetime.now(datetime.timezone.utc).date()
year, month = now.year, now.month
# "latest" transitions at the start of March and September each year.
# Before Mar 2026: latest=21. Each Mar/Sep adds one.
#
# (2026, Jan/Feb) → 21 (2026, Mar-Aug) → 22
# (2026, Sep-Dec) → 23 (2027, Jan/Feb) → 23 …
ANCHOR = 21 # latest just before Mar 2026
transitions = max(0,
(year - 2026) * 2
+ (1 if month >= 3 else 0)
+ (1 if month >= 9 else 0)
)
latest = ANCHOR + transitions
next = latest + 1
probe = subprocess.run(
['git', 'ls-remote', '--heads',
'https://github.com/llvm/llvm-project.git',
f'refs/heads/release/{next}.x'],
capture_output=True, text=True, timeout=60,
)
next_branch_exists = probe.returncode == 0 and bool(probe.stdout.strip())
include = [{"llvm": latest, "role": "llvm-latest"}]
if next_branch_exists:
include.append({"llvm": next, "role": "llvm-next"})
matrix = json.dumps({"include": include})
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
fh.write(f'matrix={matrix}\n')
suffix = f' next={next}' if next_branch_exists else ' (next branch not yet cut)'
print(f'latest={latest}{suffix}')
PYEOF
# ── Build & test ─────────────────────────────────────────────────────────
build:
name: Build (${{ matrix.role }} / v${{ matrix.llvm }})
needs: compute-versions
runs-on: ubuntu-latest
timeout-minutes: 120
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.compute-versions.outputs.matrix) }}
steps:
- name: Install LLVM v${{ matrix.llvm }} (apt.llvm.org)
run: |
sudo apt-get update
wget -qO /tmp/llvm.sh https://apt.llvm.org/llvm.sh
chmod +x /tmp/llvm.sh
sudo /tmp/llvm.sh ${{ matrix.llvm }} all
echo "LLVM_HOME=/usr/lib/llvm-${{ matrix.llvm }}" >> "$GITHUB_ENV"
- name: Install Trick dependencies
run: |
sudo apt-get install -y \
bison flex git make maven cmake zip gdb \
swig curl g++ \
libx11-dev libxml2-dev libxt-dev \
libmotif-common libmotif-dev \
zlib1g-dev libudunits2-dev \
default-jdk \
python3-dev python3-pip python3-venv \
libgtest-dev libgmock-dev
- name: Checkout repository
uses: actions/checkout@v6
- name: Configure Trick
run: |
export MAKEFLAGS=-j$(nproc)
./configure --with-llvm="$LLVM_HOME"
- name: Build Trick
run: |
export MAKEFLAGS=-j$(nproc)
export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))
make
- name: Test
run: |
cd share/trick/trickops/
python3 -m venv .venv && . .venv/bin/activate && pip3 install -r requirements.txt
cd ../../../; make test
- name: Upload Tests
uses: actions/upload-artifact@v7
if: always()
with:
name: Trick_${{ matrix.role }}
path: trick_test/*.xml
if-no-files-found: warn
retention-days: 7
# ── Reporting ─────────────────────────────────────────────────────────────
report:
name: Report (${{ matrix.role }})
needs: [compute-versions, build]
if: always()
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.compute-versions.outputs.matrix) }}
steps:
- uses: dorny/test-reporter@v3
with:
artifact: Trick_${{ matrix.role }}
name: Results_Trick_${{ matrix.role }}
path: "*.xml"
reporter: java-junit