-
Notifications
You must be signed in to change notification settings - Fork 72
184 lines (183 loc) · 6.16 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
name: CI-KA
on:
push:
branches:
- main
- release-*
tags: '*'
pull_request:
defaults:
run:
shell: bash
concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
CI:
name: CI
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# version:
# - '1.10'
# - '1.11'
# os:
# - ubuntu-latest
# - macOS-latest
# - windows-latest
# arch:
# - x64
# pocl: [jll,]
include:
- version: '1.10'
os: ubuntu-latest
arch: x64
pocl: local
allow_failure: true
- version: '1.11'
os: ubuntu-latest
arch: x64
pocl: local
allow_failure: false
# - version: 'nightly'
# os: ubuntu-latest
# arch: x64
# pocl: local
# allow_failure: true
# - version: 'nightly'
# os: ubuntu-latest
# arch: x64
# pocl: local
# allow_failure: true
# - version: 'nightly'
# os: ubuntu-latest
# arch: x64
# pocl: jll
# allow_failure: true
#
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
show-versioninfo: true
- uses: julia-actions/cache@v2
- name: Checkout pocl
if: ${{ matrix.pocl == 'local' }}
uses: actions/checkout@v4
with:
repository: pocl/pocl
path: pocl
- name: Install system dependencies
if: ${{ matrix.pocl == 'local' }}
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build pkg-config
- name: Install Julia dependencies
if: ${{ matrix.pocl == 'local' }}
run: |
touch pocl/Project.toml
julia --project=pocl --color=yes -e '
using Pkg
# unversioned
Pkg.add([
"SPIRV_Tools_jll",
"OpenCL_jll",
"OpenCL_Headers_jll",
"Hwloc_jll",
"CMake_jll",
])
# versioned
llvm_version = "$(Base.libllvm_version.major).$(Base.libllvm_version.minor)"
Pkg.add(name="LLVM_full_jll", version=llvm_version)
Pkg.add(name="SPIRV_LLVM_Translator_jll", version=llvm_version)'
- name: Build PoCL
if: ${{ matrix.pocl == 'local' }}
run: |
julia --project=pocl --color=yes -e '
using LLVM_full_jll,
SPIRV_Tools_jll, SPIRV_LLVM_Translator_jll,
OpenCL_jll, OpenCL_Headers_jll,
Hwloc_jll, CMake_jll
sourcedir = joinpath(@__DIR__, "pocl")
builddir = joinpath(@__DIR__, "build")
destdir = joinpath(@__DIR__, "target")
prefix = []
for jll in [SPIRV_Tools_jll, SPIRV_LLVM_Translator_jll, OpenCL_jll,
OpenCL_Headers_jll, Hwloc_jll]
push!(prefix, jll.artifact_dir)
end
withenv("LD_LIBRARY_PATH" => joinpath(Sys.BINDIR, Base.PRIVATE_LIBDIR)) do
mkpath(builddir)
run(```cmake -B $builddir -S $sourcedir
-GNinja
-DCMAKE_CXX_FLAGS="-fdiagnostics-color=always"
-DCMAKE_C_FLAGS="-fdiagnostics-color=always"
-DCMAKE_BUILD_TYPE=Debug
-DENABLE_TESTS:Bool=OFF
-DPOCL_DEBUG_MESSAGES:Bool=ON
-DCMAKE_INSTALL_PREFIX=$destdir
-DWITH_LLVM_CONFIG=$(LLVM_full_jll.artifact_dir)/tools/llvm-config
-DCMAKE_PREFIX_PATH="$(join(prefix, ";"))"
-DKERNELLIB_HOST_CPU_VARIANTS=distro```)
run(```$(cmake()) --build $builddir --parallel $(Sys.CPU_THREADS) --target install```)
end'
echo '[pocl_jll]' > test/LocalPreferences.toml
echo 'libpocl_path="${{ github.workspace }}/target/lib/libpocl.so"' >> test/LocalPreferences.toml
- name: "Co-develop Enzyme and KA"
run: |
julia -e '
using Pkg
withenv("JULIA_PKG_PRECOMPILE_AUTO" => 0) do
Pkg.activate("test")
Pkg.add(["Enzyme", "EnzymeCore"])
# to check compatibility, also add Enzyme to the main environment
# (or Pkg.test, which merges both environments, could fail)
Pkg.activate(".")
# Try to co-develop Enzyme and KA
try
Pkg.develop([PackageSpec("Enzyme"), PackageSpec("EnzymeCore")])
catch err
end
end
'
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
with:
annotate: true
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
with:
file: lcov.info
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1'
- run: |
julia --project=docs -e 'import Pkg; Pkg.develop(path=".")'
julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
doctests:
name: Doctests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1'
- run: |
julia --project=docs -e 'import Pkg; Pkg.develop(path=".")'
julia --project=docs -e '
using Documenter: doctest
using KernelAbstractions
doctest(KernelAbstractions; manual = true)'