-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
339 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: MLIR JL tblgen CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
tags: '*' | ||
|
||
jobs: | ||
test: | ||
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: | ||
- '1.9' | ||
- '1.10' | ||
- 'nightly' | ||
os: | ||
- ubuntu-latest | ||
arch: | ||
- x64 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: julia-actions/setup-julia@v1 | ||
with: | ||
version: ${{ matrix.version }} | ||
arch: ${{ matrix.arch }} | ||
- uses: actions/cache@v1 | ||
env: | ||
cache-name: cache-artifacts | ||
with: | ||
path: ~/.julia/artifacts | ||
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-test-${{ env.cache-name }}- | ||
${{ runner.os }}-test- | ||
${{ runner.os }}- | ||
- uses: julia-actions/julia-buildpkg@v1 | ||
- uses: julia-actions/julia-runtest@v1 | ||
- uses: julia-actions/julia-processcoverage@v1 | ||
- uses: codecov/codecov-action@v1 | ||
with: | ||
file: lcov.info | ||
docs: | ||
name: Documentation | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: julia-actions/setup-julia@v1 | ||
with: | ||
version: '1' | ||
- run: | | ||
julia --project=docs -e ' | ||
using Pkg | ||
Pkg.develop(PackageSpec(path=pwd())) | ||
Pkg.instantiate()' | ||
- run: | | ||
julia --project=docs -e ' | ||
using Documenter: doctest | ||
using MLIR | ||
doctest(MLIR)' # change MYPACKAGE to the name of your package | ||
- run: julia --project=docs docs/make.jl | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using Pkg | ||
Pkg.activate(@__DIR__) | ||
Pkg.instantiate() | ||
|
||
using Git, Scratch, Dates | ||
|
||
MLIR = Base.UUID("bfde9dd4-8f40-4a1e-be09-1475335e1c92") | ||
|
||
# get scratch directories | ||
support_dir = get_scratch!(LLVM, "support") | ||
|
||
# is this a full-fledged check-out? | ||
if isdir(joinpath(@__DIR__), "..", ".git") | ||
# determine latest change to the wrappers | ||
deps_timestamp = parse(Int, read(`$(git()) -C $(@__DIR__) log -1 --format=%ct LLVMExtra`, String)) | ||
@info "Latest change to the wrappers: $(unix2datetime(deps_timestamp))" | ||
|
||
# find out which version of LLVMExtra_jll we are using | ||
Pkg.activate(joinpath(@__DIR__, "..")) | ||
deps = collect(values(Pkg.dependencies())) | ||
filter!(deps) do dep | ||
dep.name == "LLVMExtra_jll" | ||
end | ||
library_version = only(deps).version | ||
@info "LLVMExtra_jll version: $(library_version)" | ||
|
||
# compare to the JLL's tags | ||
jll_tags = mktempdir() do dir | ||
if !isdir(joinpath(support_dir, ".git")) | ||
run(`$(git()) clone -q https://github.com/JuliaBinaryWrappers/LLVMExtra_jll.jl $dir`) | ||
else | ||
run(`$(git()) -C $dir fetch -q`) | ||
end | ||
tags = Dict{String,Int}() | ||
for line in eachline(`$(git()) -C $dir tag --format "%(refname:short) %(creatordate:unix)"`) | ||
tag, timestamp = split(line) | ||
tags[tag] = parse(Int, timestamp) | ||
end | ||
tags | ||
end | ||
jll_timestamp = jll_tags["LLVMExtra-v$(library_version)"] | ||
@info "LLVMExtra_jll timestamp: $(unix2datetime(jll_timestamp))" | ||
|
||
if deps_timestamp > jll_timestamp | ||
@info "Wrappers have changed since the last JLL build. Building the support library locally." | ||
include(joinpath(@__DIR__, "build_local.jl")) | ||
else | ||
@info "Wrappers have not changed since the last JLL build. Using the JLL's support library." | ||
end | ||
else | ||
@warn """LLVM.jl source code is not checked-out from Git. | ||
This means we cannot check for changes, and need to unconditionally build the support library.""" | ||
include(joinpath(@__DIR__, "build_local.jl")) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.