-
Notifications
You must be signed in to change notification settings - Fork 8
110 lines (104 loc) · 3.48 KB
/
verify.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
name: Verify
concurrency: verify
on:
push:
branches: [ main ]
workflow_dispatch:
repository_dispatch:
types: [on-llvm-update]
jobs:
build-debug:
runs-on: ubuntu-latest
steps:
- name: Install build dependencies.
run: |
sudo apt-get install cmake ninja-build lld
- name: Check out the compiler.
uses: actions/checkout@v2
with:
repository: 'llvm-mos/llvm-mos'
path: 'llvm-mos'
- name: Setup ccache
uses: hendrikmuhs/[email protected]
with:
# A full build of llvm, clang, lld, and lldb takes about 250MB
# of ccache space. There's not much reason to have more than this,
# because we usually won't need to save cache entries from older
# builds. Also, there is an overall 10GB cache limit, and each
# run creates a new cache entry so we want to ensure that we have
# enough cache space for all the tests to run at once and still
# fit under the 10 GB limit.
max-size: 500M
key: sccache-${{ matrix.os }}
variant: sccache
- name: Build the compiler.
run: |
cd llvm-mos
cmake -C clang/cmake/caches/MOS.cmake -G Ninja -S llvm -B build -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_USE_LINKER=lld -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
cd build
cmake --build . --target builtins clang lld llvm-ar llvm-ranlib llvm-size llvm-mlb
- name: Archive the compiler.
run: |
for dir in build/{bin,lib/clang} llvm/utils; do
mkdir -p staging/llvm-mos/$(dirname $dir)
mv llvm-mos/$dir staging/llvm-mos/$(dirname $dir)
done
rm -rf llvm-mos
cd staging
tar --zstd -cf ../compiler.tar.zst llvm-mos
cd ..
rm -rf staging
- name: Upload the compiler.
uses: actions/upload-artifact@v4
with:
name: compiler
path: compiler.tar.zst
verify:
needs: build-debug
runs-on: ubuntu-latest
strategy:
matrix:
opt: [O0, O3, Os, Oz]
fail-fast: false
steps:
- name: Install build dependencies.
run: |
sudo apt-get install cmake ninja-build llvm
- name: Download the compiler.
uses: actions/download-artifact@v4
with:
name: compiler
- name: Extract the compiler.
run: tar -xpf compiler.tar.zst
- name: Check out the SDK.
uses: actions/checkout@v2
with:
repository: 'llvm-mos/llvm-mos-sdk'
path: 'llvm-mos-sdk'
- name: Build the SDK.
run: |
cd llvm-mos-sdk
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/llvm-mos/build -G "Ninja" ..
ninja install
- name: Check out the test suite.
uses: actions/checkout@v2
with:
path: 'llvm-test-suite'
- name: Verify the test suite.
run: |
cd llvm-test-suite
mkdir build
cd build
cmake -DLLVM_MOS=$GITHUB_WORKSPACE/llvm-mos/build \
-C../cmake/caches/${{ matrix.opt }}.cmake \
-C../cmake/caches/target-mos.cmake \
-DTEST_SUITE_ARCH_FLAGS="-Wl,-mllvm,-verify-machineinstrs" \
-G Ninja \
..
ninja
- name: Run the test suite.
run: |
cd llvm-test-suite/build
$GITHUB_WORKSPACE/llvm-mos/build/bin/llvm-lit .