-
Notifications
You must be signed in to change notification settings - Fork 2
113 lines (105 loc) · 3.13 KB
/
llvm-19.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
name: Test workflow with LLVM 19
on:
push:
branches:
- llvm19
workflow_dispatch:
env:
MCDC_HOME: /home/github-runner/mcdc-workdir
jobs:
find_runner:
name: Find an available self-hosted runner
runs-on: self-hosted
# Enforce this same runner for all later jobs that depend on this one
# FIXME this requires each runner has a label the same as its name
outputs:
runner_name: ${{ runner.name }}
# Dummy, do nothing
steps:
- uses: actions/checkout@v4
install_deps:
name: 1. Install dependencies
needs: find_runner
# Enforce the same runner
runs-on: ${{ needs.find_runner.outputs.runner_name }}
outputs:
runner_name: ${{ runner.name }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: ./ci/1_install_deps.sh
pull_source:
name: 2. Pull the source code and apply patches
needs: install_deps
# Enforce the same runner
runs-on: ${{ needs.install_deps.outputs.runner_name }}
outputs:
runner_name: ${{ runner.name }}
steps:
- uses: actions/checkout@v4
- name: Create a workspace from clean slate
run: |
rm -rf $MCDC_HOME
mkdir -p $MCDC_HOME
- name: Pull the source code and apply patches
run: ./ci/2_pull_source.sh
get_llvm:
name: 3. Get LLVM
needs: pull_source
# Enforce the same runner
runs-on: ${{ needs.pull_source.outputs.runner_name }}
outputs:
runner_name: ${{ runner.name }}
steps:
- uses: actions/checkout@v4
- name: Build from source
run: ./ci/3_get_llvm.sh
- name: Print LLVM build resource usage
run: |
cat /tmp/time.log
du -sh $MCDC_HOME/llvm-project
build_kernel:
name: 4. Build the kernel
needs: get_llvm
# Enforce the same runner
runs-on: ${{ needs.get_llvm.outputs.runner_name }}
outputs:
runner_name: ${{ runner.name }}
steps:
- uses: actions/checkout@v4
- name: Set up LLVM path
run: echo "$MCDC_HOME/llvm-project/build/bin" >> $GITHUB_PATH
- name: Print toolchain version
run: |
clang -v
llc --version
- name: Build the kernel
run: ./ci/4_build_kernel.sh
- name: Print full kernel build log
run: cat /tmp/make.log
- name: Print kernel build resource usage
run: |
cat /tmp/time.log
du -sh $MCDC_HOME/linux
- name: Print kernel binary layout
run: |
llvm-readelf --sections -W $MCDC_HOME/linux/vmlinux
boot_kernel_and_collect_coverage:
name: 5. Boot the kernel and collect coverage
needs: build_kernel
# Enforce the same runner
runs-on: ${{ needs.build_kernel.outputs.runner_name }}
outputs:
runner_name: ${{ runner.name }}
steps:
- uses: actions/checkout@v4
- name: Set up LLVM path
run: echo "$MCDC_HOME/llvm-project/build/bin" >> $GITHUB_PATH
- name: Print toolchain version
run: |
clang -v
llc --version
- name: Boot the kernel and collect coverage
run: ./ci/5_boot_kernel_and_collect_coverage.sh
- name: Print the index of coverage report
run: cat $MCDC_HOME/analysis/text-coverage-reports/index.txt