-
Notifications
You must be signed in to change notification settings - Fork 347
156 lines (141 loc) · 6.25 KB
/
build.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
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
153
154
155
156
name: build
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch: ["Win32", "x64"] # "ARM64"
steps:
- uses: actions/checkout@v2
with:
repository: llvm/llvm-project
ref: llvmorg-17.0.0-rc3
path: llvm-project
fetch-depth: 1
- name: Get LLVM Revision
id: llvm-revision
run: |
echo "revision=$(git -C ${{ github.workspace }}/llvm-project rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v2
id: llvm-build
with:
path: ${{ github.workspace }}/build/llvm-project
key: ${{ runner.os }}-${{ matrix.arch }}-${{ steps.llvm-revision.outputs.revision }}
- name: configure LLVM
if: steps.llvm-build.outputs.cache-hit != 'true'
run: cmake -B ${{ github.workspace }}/build/llvm-project -D CMAKE_BUILD_TYPE=Release -G "Visual Studio 17 2022" -S ${{ github.workspace }}/llvm-project/llvm
- name: build LLVM tools
if: steps.llvm-build.outputs.cache-hit != 'true'
run: |
cmake --build ${{ github.workspace }}/build/llvm-project --config Release --target FileCheck
cmake --build ${{ github.workspace }}/build/llvm-project --config Release --target yaml2obj
- uses: actions/checkout@v2
with:
path: bloaty
- name: configure
run: cmake -B build/bloaty -D CMAKE_BUILD_TYPE=Debug -G "Visual Studio 17 2022" -A ${{ matrix.arch }} -S ${{ github.workspace }}/bloaty -D FILECHECK_EXECUTABLE=${{ github.workspace }}/build/llvm-project/Release/bin/FileCheck.exe -D YAML2OBJ_EXECUTABLE=${{ github.workspace }}/build/llvm-project/Release/bin/yaml2obj.exe -D LIT_EXECUTABLE=${{ github.workspace }}/llvm-project/llvm/utils/lit/lit.py
- name: build
run: cmake --build build/bloaty --config Debug
- name: test
run: |
cmake --build build/bloaty --config Debug --target RUN_TESTS
cmake --build build/bloaty --config Debug --target check-bloaty
macOS:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
include:
- { cflags: "", cxxflags: "" }
- { cflags: "-fmodules", cxxflags: "-fmodules" }
steps:
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: actions/checkout@v2
with:
repository: llvm/llvm-project
ref: llvmorg-17.0.0-rc3
path: llvm-project
fetch-depth: 1
- name: Get LLVM Revision
id: llvm-revision
run: |
echo "revision=$(git -C ${{ github.workspace }}/llvm-project rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v2
id: llvm-build
with:
path: ${{ github.workspace }}/build/llvm-project
key: ${{ runner.os }}-${{ steps.llvm-revision.outputs.revision }}
- name: configure LLVM
if: steps.llvm-build.outputs.cache-hit != 'true'
run: cmake -B ${{ github.workspace }}/build/llvm-project -D CMAKE_BUILD_TYPE=Release -G Ninja -S ${{ github.workspace }}/llvm-project/llvm
- name: build LLVM tools
if: steps.llvm-build.outputs.cache-hit != 'true'
run: |
cmake --build ${{ github.workspace }}/build/llvm-project --target FileCheck
cmake --build ${{ github.workspace }}/build/llvm-project --target yaml2obj
- uses: actions/checkout@v2
with:
path: ${{ github.workspace }}/bloaty
- name: configure
run: cmake -B build/bloaty -D CMAKE_BUILD_TYPE=Debug -D CMAKE_C_FLAGS=${{ matrix.cflags }} -D CMAKE_CXX_FLAGS=${{ matrix.cxxflags }} -G Ninja -S ${{ github.workspace }}/bloaty -D BLOATY_PREFER_SYSTEM_CAPSTONE=NO -D FILECHECK_EXECUTABLE=${{ github.workspace }}/build/llvm-project/bin/FileCheck -D YAML2OBJ_EXECUTABLE=${{ github.workspace }}/build/llvm-project/bin/yaml2obj -D LIT_EXECUTABLE=${{ github.workspace }}/llvm-project/llvm/utils/lit/lit.py
- name: build
run: cmake --build build/bloaty --config Debug
- name: test
run: |
cmake --build build/bloaty --config Debug --target test
cmake --build build/bloaty --config Debug --target check-bloaty
ubuntu:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- { CC: gcc, CXX: g++ }
- { CC: clang, CXX: clang++ }
steps:
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: actions/checkout@v2
with:
repository: llvm/llvm-project
ref: llvmorg-17.0.0-rc3
path: llvm-project
fetch-depth: 1
- name: Get LLVM Revision
id: llvm-revision
run: |
echo "revision=$(git -C ${{ github.workspace }}/llvm-project rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v2
id: llvm-build
with:
path: ${{ github.workspace }}/build/llvm-project
key: ${{ runner.os }}-${{ steps.llvm-revision.outputs.revision }}
- name: configure LLVM
if: steps.llvm-build.outputs.cache-hit != 'true'
run: cmake -B ${{ github.workspace }}/build/llvm-project -D CMAKE_BUILD_TYPE=Release -G Ninja -S ${{ github.workspace }}/llvm-project/llvm
- name: build LLVM tools
if: steps.llvm-build.outputs.cache-hit != 'true'
run: |
cmake --build ${{ github.workspace }}/build/llvm-project --target FileCheck
cmake --build ${{ github.workspace }}/build/llvm-project --target yaml2obj
- uses: actions/checkout@v2
with:
path: ${{ github.workspace }}/bloaty
- name: configure
run: cmake -B build/bloaty -D CMAKE_BUILD_TYPE=Debug -G Ninja -S ${{ github.workspace }}/bloaty -D FILECHECK_EXECUTABLE=${{ github.workspace }}/build/llvm-project/bin/FileCheck -D YAML2OBJ_EXECUTABLE=${{ github.workspace }}/build/llvm-project/bin/yaml2obj -D LIT_EXECUTABLE=${{ github.workspace }}/llvm-project/llvm/utils/lit/lit.py
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
- name: build
run: cmake --build build/bloaty --config Debug
- name: test
run: |
cmake --build build/bloaty --config Debug --target test
cmake --build build/bloaty --config Debug --target check-bloaty