-
Notifications
You must be signed in to change notification settings - Fork 3
140 lines (114 loc) · 3.97 KB
/
build.yaml
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
name: Builds
permissions:
contents: read
actions: write
on:
push:
branches: [ "main" ]
pull_request:
jobs:
build-compiler:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install minimum required cmake and ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.21.0"
- name: Install CCache
uses: Chocobo1/setup-ccache-action@v1
with:
ccache_options: |
max_size=400M
compiler_check=none
- name: Install Compiler
run: |
sudo apt-get update
sudo apt-get install lld clang
- name: Configure
run: |
cmake -G Ninja -Bquidditch-compiler-build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DIREE_ENABLE_ASSERTIONS=ON \
-DIREE_ENABLE_LLD=ON \
-DIREE_ENABLE_THIN_ARCHIVES=ON \
-DIREE_HAL_DRIVER_DEFAULTS=OFF \
-DIREE_TARGET_BACKEND_DEFAULTS=OFF \
-DIREE_TARGET_BACKEND_LLVM_CPU=ON \
-DPython3_ROOT_DIR="$pythonLocation" \
-DPython3_FIND_STRATEGY=LOCATION \
-S ${{github.workspace}}/codegen
- name: Build
run: cmake --build quidditch-compiler-build --target iree-compile
# TODO: Test?
- name: Remove object files prior to upload
working-directory: ${{github.workspace}}/quidditch-compiler-build
run: |
find . -name "*.o" -type f -delete
- name: Tar build directory
working-directory: ${{github.workspace}}
run: |
tar -cvf quidditch-compiler-build.tar quidditch-compiler-build
- name: Upload iree-compile
uses: actions/upload-artifact@v4
with:
name: quidditch-compiler-build-dir
path: quidditch-compiler-build.tar
build-runtime:
runs-on: ubuntu-22.04
needs: [ build-compiler ]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Download Quidditch Toolchain
run: |
mkdir ./toolchain
# TODO: This should use main instead before landing.
docker run --rm ghcr.io/opencompl/Quidditch/toolchain:${{ github.ref_name }} tar -cC /opt/quidditch-toolchain . \
| tar -xC ./toolchain
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install Python dependencies
run: python -m pip install -r runtime/requirements.txt
- name: Install minimum required cmake and ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.21.0"
- name: Install bender
uses: baptiste0928/cargo-install@v3
with:
crate: bender
version: '~0.28.0'
- name: Download iree-compile
uses: actions/download-artifact@v4
with:
name: quidditch-compiler-build-dir
- name: Untar iree-compile
run: |
tar -xf quidditch-compiler-build.tar
- name: Configure build
run: |
cmake -GNinja -Bquidditch-runtime-build \
-DQUIDDITCH_CODEGEN_BUILD_DIR=${{github.workspace}}/quidditch-compiler-build \
-DQUIDDITCH_TOOLCHAIN_ROOT=${{github.workspace}}/toolchain \
-DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/runtime/ToolchainFile.cmake
-S ${{github.workspace}}/runtime
- name: Build
run: cmake --build quidditch-runtime-build
- name: Test
working-directory: ${{github.workspace}}/quidditch-runtime-build
# TODO: This should run a proper test suite once we are no longer using verilator.
run: ctest --extra-verbose -j$(nproc) -R HelloWorld