1
1
name : CI Linux
2
2
3
3
on :
4
- workflow_call :
5
4
workflow_dispatch :
5
+ inputs :
6
+ force_debug_with_tmate :
7
+ type : boolean
8
+ description : ' Run the build with tmate session'
9
+ required : false
10
+ default : false
11
+ debug_with_tmate :
12
+ type : boolean
13
+ description : ' Run the build with a tmate session ONLY in case of failure'
14
+ required : false
15
+ default : false
16
+ release :
17
+ type : boolean
18
+ description : ' Release to latest'
19
+ required : false
20
+ default : false
6
21
pull_request :
7
22
merge_group :
8
23
push :
9
24
branches :
10
25
- main
11
26
12
27
concurrency :
13
- # A PR number if a pull request and otherwise the commit hash. This cancels
14
- # queued and in-progress runs for the same PR (presubmit) or commit
15
- # (postsubmit).
16
28
group : ci-build-test-cpp-linux-${{ github.event.number || github.sha }}
17
29
cancel-in-progress : true
18
30
19
31
jobs :
20
32
build :
21
33
name : Build (linux)
22
- strategy :
23
- fail-fast : false
24
- matrix :
25
- runs-on :
26
- - ubuntu-22.04
27
- # - nod-ai-shared-cpubuilder-manylinux-x86_64
28
- runs-on : ${{ matrix.runs-on }}
34
+ runs-on : ubuntu-22.04
35
+ container :
36
+ image : quay.io/pypa/manylinux_2_28_x86_64
37
+ env :
38
+ GITHUB_SHA : ${{ github.sha }}
29
39
steps :
30
40
- name : Install tmate
31
- if : ${{ matrix.runs-on == 'nod-ai-shared-cpubuilder-manylinux-x86_64' }}
32
41
run : dnf install -y epel-release && dnf install -y tmate
33
42
34
- - name : Configure local git mirrors
35
- if : ${{ matrix.runs-on == 'nod-ai-shared-cpubuilder-manylinux-x86_64' }}
36
- run : |
37
- /gitmirror/scripts/trigger_update_mirrors.sh
38
- /gitmirror/scripts/git_config.sh
39
-
40
43
- name : Install deps
41
- if : ${{ matrix.runs-on == 'nod-ai-shared-cpubuilder-manylinux-x86_64' }}
42
44
run : |
43
45
dnf install -y almalinux-release-devel
44
- yum install -y elfutils-libelf-devel p7zip p7zip-plugins
45
-
46
- - name : Install deps
47
- if : ${{ matrix.runs-on == 'ubuntu-22.04' }}
48
- run : |
49
- sudo apt install -y libelf-dev libnuma-dev libdrm-dev
46
+ yum install -y elfutils-libelf-devel p7zip p7zip-plugins \
47
+ sudo ncurses-compat-libs openssh vim-common
50
48
51
49
- name : Setup Cpp
52
- if : ${{ matrix.runs-on == 'ubuntu-22.04' }}
53
50
uses : aminya/setup-cpp@v1
54
51
with :
55
52
compiler : llvm-18
56
53
cmake : true
57
54
ninja : true
58
- ccache : true
59
55
60
56
- name : " Checking out repository"
61
57
uses : actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
62
58
with :
63
59
submodules : recursive
64
60
65
61
- name : Build and install libnuma
66
- if : ${{ matrix.runs-on == 'nod-ai-shared-cpubuilder-manylinux-x86_64' }}
67
62
run : |
68
63
curl --silent -L \
69
64
https://github.com/numactl/numactl/releases/download/v2.0.18/numactl-2.0.18.tar.gz \
70
65
-o numactl-2.0.18.tar.gz
71
66
tar -xf numactl-2.0.18.tar.gz
72
67
pushd numactl-2.0.18
73
68
./configure
69
+ # i have no idea why this is necessary
70
+ # but without it you get something about "can't cd into dir"
71
+ sed -i '7563s/`cd "$dir" && pwd`/$dir/g' libtool
74
72
make install
75
73
popd
76
74
@@ -82,22 +80,22 @@ jobs:
82
80
83
81
- name : Build ROCR distro
84
82
run : |
85
- rocr_dir="$(cd ${{ github.workspace }} && pwd)"
86
- build_rocr_dir="${{ github.workspace }} /rocr-build"
83
+ rocr_dir="$(cd $GITHUB_WORKSPACE && pwd)"
84
+ build_rocr_dir="$GITHUB_WORKSPACE /rocr-build"
87
85
mkdir -p "$build_rocr_dir"
88
86
build_rocr_dir="$(cd $build_rocr_dir && pwd)"
89
- rocr_install_dir="${{ github.workspace }} /rocr-install"
87
+ rocr_install_dir="$GITHUB_WORKSPACE /rocr-install"
90
88
91
89
cmake -GNinja \
92
90
-DCMAKE_BUILD_TYPE=Release \
93
91
-DCMAKE_INSTALL_PREFIX="$rocr_install_dir" \
94
- -DClang_DIR=/usr/lib/ llvm-18 /lib/cmake/clang \
95
- -DLLVM_DIR=/usr/lib/ llvm-18 /lib/cmake/llvm \
92
+ -DClang_DIR=$HOME/ llvm/lib/cmake/clang \
93
+ -DLLVM_DIR=$HOME/ llvm/lib/cmake/llvm \
96
94
-DIMAGE_SUPPORT=OFF \
97
95
-S "$rocr_dir" -B "$build_rocr_dir"
98
96
99
97
cmake --build "$build_rocr_dir" --target install
100
- tar -cf rocr-$(git rev-parse --short HEAD) .tar rocr-install
98
+ tar -cf rocr-${GITHUB_SHA::8} .tar rocr-install
101
99
102
100
- name : Upload artifacts
103
101
uses : actions/upload-artifact@v4
@@ -108,11 +106,11 @@ jobs:
108
106
if-no-files-found : warn
109
107
110
108
- name : Setup tmate session
111
- if : ${{ failure() }}
109
+ if : ${{ ( failure() && inputs.debug_with_tmate) || inputs.force_debug_with_tmate }}
112
110
113
111
with :
114
112
limit-access-to-actor : true
115
- install-dependencies : ${{ matrix.runs-on == 'ubuntu-22.04' }}
113
+ install-dependencies : false
116
114
117
115
test_aie :
118
116
name : AIE tests
@@ -144,7 +142,7 @@ jobs:
144
142
mkdir -p $build_dir
145
143
cmake -GNinja \
146
144
-DCMAKE_BUILD_TYPE=Release \
147
- "-Dhsa-runtime64_DIR=$hsa_runtime64_ROOT/lib /cmake/hsa-runtime64" \
145
+ "-Dhsa-runtime64_DIR=$hsa_runtime64_ROOT/lib64 /cmake/hsa-runtime64" \
148
146
-S "$PWD" -B "$build_dir"
149
147
cmake --build "$build_dir" --target aie_hsa_bare_add_one
150
148
@@ -160,9 +158,36 @@ jobs:
160
158
mkdir -p $build_dir
161
159
cmake -GNinja \
162
160
-DCMAKE_BUILD_TYPE=Release \
163
- "-Dhsa-runtime64_DIR=$hsa_runtime64_ROOT/lib /cmake/hsa-runtime64" \
161
+ "-Dhsa-runtime64_DIR=$hsa_runtime64_ROOT/lib64 /cmake/hsa-runtime64" \
164
162
-S "$PWD" -B "$build_dir"
165
163
166
164
! cmake --build "$build_dir" --target aie_hsa_dispatch_test
167
165
168
166
popd
167
+
168
+ release :
169
+ name : Release
170
+ if : ${{ inputs.release }}
171
+ needs : [build, test_aie]
172
+ runs-on : ubuntu-22.04
173
+ permissions :
174
+ id-token : write
175
+ contents : write
176
+ steps :
177
+ - name : Download artifacts
178
+ uses : actions/download-artifact@v4
179
+ with :
180
+ name : linux_x86_64_distro
181
+
182
+ - name : Release current commit
183
+
184
+ with :
185
+ artifacts : rocr-*.tar
186
+ token : " ${{ secrets.GITHUB_TOKEN }}"
187
+ tag : " latest"
188
+ name : " latest"
189
+ removeArtifacts : false
190
+ allowUpdates : true
191
+ replacesArtifacts : true
192
+ makeLatest : true
193
+ artifactErrorsFailBuild : true
0 commit comments