-
Notifications
You must be signed in to change notification settings - Fork 1
194 lines (181 loc) · 5.85 KB
/
CI.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
name: CI
on:
push:
tags:
- "*"
branches-ignore:
- "**/docs?"
pull_request:
branches-ignore:
- "**/docs?"
jobs:
build-cpp:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
steps:
- name: Checkout myself
uses: actions/checkout@v1
- name: Restore timestamp for patched clang files
run: |
for file in backend/clang/*; do
touch "${file}" \
--date="$(git log --max-count=1 --pretty=format:%cD -- "${file}")"
done
- name: Install dependencies
run: |
sudo apt-get purge -y libgcc-*-dev || true
./.github/scripts/install-build-deps.sh
./.github/scripts/setup-github-hosted.sh
- name: Configure myself
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Release
- name: Cache llvm-src
uses: actions/cache@v3
with:
path: build/_deps/llvm-src
key: ${{ matrix.os }}-llvm-src-202206-2
- name: Cache llvm-build
uses: actions/cache@v3
with:
path: build/_deps/llvm-build
key: ${{ matrix.os }}-llvm-build-202206-2
- name: Cache llvm-subbuild
uses: actions/cache@v3
with:
path: build/_deps/llvm-subbuild
key: ${{ matrix.os }}-llvm-subbuild-202206-2
- name: Build myself
run: cmake --build build --target all
- name: Test myself
run: cmake --build build --target test
- name: Package myself
run: cmake --build build --target package
- name: Upload deb package
uses: actions/upload-artifact@v3
with:
name: tapa-cpp-${{ matrix.os }}
path: build/*.deb
release-cpp:
if: github.event_name == 'push' && github.repository == 'Blaok/tapa' && startsWith(github.event.ref, 'refs/tags')
runs-on: ${{ matrix.os }}
concurrency: release-cpp
strategy:
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
needs:
- build-cpp
steps:
- name: Checkout myself
uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: tapa-cpp-${{ matrix.os }}
path: build
- name: Cache APT database
uses: actions/cache@v3
with:
path: apt-db-cache
key: ${{ runner.os }}-apt-db-cache
- name: Update APT repository
run: ./.github/scripts/upload-apt-repo.sh
env:
BUILD_DIR: build
CACHE_DIR: apt-db-cache
LABEL: Extending High-Level Synthesis for Task-Parallel Programs
GPG_KEY: ${{ secrets.GPG_KEY }}
SSH_KEY: ${{ secrets.SSH_KEY }}
build-python:
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install build
run: pip install --upgrade build
- name: Checkout myself
uses: actions/checkout@v3
- name: Build myself
run: python -m build backend/python
- name: Upload whl package
uses: actions/upload-artifact@v3
with:
name: tapa-python
path: backend/python/dist/*.whl
- name: Publish to PyPI
if: github.event_name == 'push' && github.repository == 'Blaok/tapa' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
packages_dir: backend/python/dist/
cosim:
if: github.repository == 'UCLA-VAST/tapa'
needs:
- build-cpp
- build-python
runs-on:
- self-hosted
- Linux
- xilinx-tools
strategy:
fail-fast: false
matrix:
xocl-platform:
- xilinx_u250_xdma_201830_2
xocl-version:
- "2020.2"
- "2021.1"
- "2021.2"
include:
# Test different tool versions
- xocl-platform: xilinx_u250_xdma_201830_2
# Test a platform that does not support floorplanning yet
- xocl-platform: xilinx_u200_xdma_201830_2
xocl-version: "2021.2"
# Vitis 2022.1 requires this platform
- xocl-platform: xilinx_u250_gen3x16_xdma_4_1_202210_1
xocl-version: "2022.1"
env:
XILINX_HLS: /opt/tools/xilinx/Vitis_HLS/${{ matrix.xocl-version }}
XILINX_VITIS: /opt/tools/xilinx/Vitis/${{ matrix.xocl-version }}
XILINX_VIVADO: /opt/tools/xilinx/Vivado/${{ matrix.xocl-version }}
steps:
- name: Checkout myself
uses: actions/checkout@v1
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Install dependencies
run: |
.github/scripts/setup-self-hosted.sh
sudo apt-get update
eval "$(grep ^VERSION_ID /etc/os-release)"
sudo apt-get install -y --no-install-recommends -f \
./artifacts/tapa-cpp-ubuntu-"${VERSION_ID}"/*.deb
python3 -m pip install artifacts/tapa-python/*.whl
sudo apt-get install -y --no-install-recommends \
xilinx-u200-xdma-dev \
xilinx-u250-xdma-dev \
xilinx-u250-gen3x16-xdma-4.1-202210-1-dev \
- name: Configure apps
run: |
for app in apps/*; do
[[ ! -d "${app}" ]] && continue
cmake \
-S "${app}" \
-B "${app}"/build \
-D PLATFORM=${{ matrix.xocl-platform }}
done
- name: Test apps
run: |
source ${XILINX_VITIS}/settings64.sh
# Run all apps in parallel, each with a parallelism of $(nproc).
parallel -ij100 \
make -C apps/{}/build {}-cosim -j $(nproc) \
-- $(find apps -mindepth 1 -maxdepth 1 -type d -printf "%f\n")