Skip to content

Commit e902a6d

Browse files
authored
bump cov - up ci.yml - fix tests on local build (#96)
1 parent cec7c3f commit e902a6d

File tree

4 files changed

+38
-58
lines changed

4 files changed

+38
-58
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
version:
18-
- '1.0'
18+
- '1.6' # latest LTS
1919
- '1'
2020
- 'nightly'
2121
os:
@@ -25,36 +25,36 @@ jobs:
2525
arch:
2626
- x64
2727
steps:
28-
- uses: actions/checkout@v2
29-
- uses: julia-actions/setup-julia@v1
28+
- uses: actions/checkout@v3
29+
- uses: julia-actions/setup-julia@latest
3030
with:
3131
version: ${{ matrix.version }}
3232
arch: ${{ matrix.arch }}
33-
- uses: actions/cache@v1
34-
env:
35-
cache-name: cache-artifacts
36-
with:
37-
path: ~/.julia/artifacts
38-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
39-
restore-keys: |
40-
${{ runner.os }}-test-${{ env.cache-name }}-
41-
${{ runner.os }}-test-
42-
${{ runner.os }}-
43-
- uses: julia-actions/julia-buildpkg@v1
44-
- uses: julia-actions/julia-runtest@v1
33+
- uses: julia-actions/cache@v1
34+
- uses: julia-actions/julia-buildpkg@latest
35+
- uses: julia-actions/julia-runtest@latest
4536
- name: Revise tests
4637
if: ${{ matrix.os == 'ubuntu-latest' }}
47-
run: julia -e 'using Pkg; Pkg.develop(PackageSpec(path=".")); Pkg.add(PackageSpec(url="https://github.com/timholy/Revise.jl")); Pkg.test("Revise")'
38+
run: |
39+
julia -e '
40+
using Pkg
41+
Pkg.develop(path=".")
42+
Pkg.add(url="https://github.com/timholy/Revise.jl")
43+
Pkg.test("Revise")
44+
'
4845
- name: Test while running Revise
4946
if: ${{ matrix.os == 'ubuntu-latest' && matrix.version != '1.0' }}
50-
run: TERM="xterm" julia --project -i --code-coverage -e 'using InteractiveUtils, REPL, Revise, Pkg;
51-
Pkg.add("ColorTypes");
52-
@async(Base.run_main_repl(true, true, false, true, false));
53-
sleep(2);
54-
cd("test");
55-
include("runtests.jl");
56-
REPL.eval_user_input(:(exit()), Base.active_repl_backend)'
57-
- uses: julia-actions/julia-processcoverage@v1
58-
- uses: codecov/codecov-action@v1
47+
run: |
48+
TERM="xterm" julia --project -i --code-coverage -e '
49+
using InteractiveUtils, REPL, Revise, Pkg
50+
Pkg.add("ColorTypes")
51+
# @async(Base.run_main_repl(true, true, false, true, false))
52+
sleep(2)
53+
cd("test")
54+
include("runtests.jl")
55+
REPL.eval_user_input(:(exit()), Base.active_repl_backend)
56+
'
57+
- uses: julia-actions/julia-processcoverage@latest
58+
- uses: codecov/codecov-action@v3
5959
with:
6060
file: lcov.info

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
88
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
99

1010
[compat]
11-
julia = "1"
11+
julia = "1.6"
1212

1313
[extras]
1414
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"

src/utils.jl

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ function maybe_fix_path(file)
117117
end
118118

119119
safe_isfile(x) = try isfile(x); catch; false end
120-
const BUILDBOT_STDLIB_PATH = dirname(abspath(joinpath(String((@which uuid1()).file), "..", "..", "..")))
120+
const BUILDBOT_STDLIB_PATH = dirname(abspath(String((@which uuid1()).file), "..", "..", ".."))
121121
replace_buildbot_stdlibpath(str::String) = replace(str, BUILDBOT_STDLIB_PATH => Sys.STDLIB)
122122
"""
123123
path = maybe_fixup_stdlib_path(path::String)
@@ -145,33 +145,6 @@ function postpath(filename, pre)
145145
return post
146146
end
147147

148-
if Base.VERSION < v"1.1"
149-
function splitpath(p::String)
150-
# splitpath became available with Julia 1.1
151-
# Implementation copied from Base except doesn't handle the drive
152-
out = String[]
153-
isempty(p) && (pushfirst!(out,p)) # "" means the current directory.
154-
while !isempty(p)
155-
dir, base = _splitdir_nodrive(p)
156-
dir == p && (pushfirst!(out, dir); break) # Reached root node.
157-
if !isempty(base) # Skip trailing '/' in basename
158-
pushfirst!(out, base)
159-
end
160-
p = dir
161-
end
162-
return out
163-
end
164-
splitpath(p::AbstractString) = splitpath(String(p))
165-
166-
_splitdir_nodrive(path::String) = _splitdir_nodrive("", path)
167-
function _splitdir_nodrive(a::String, b::String)
168-
m = match(Base.Filesystem.path_dir_splitter,b)
169-
m === nothing && return (a,b)
170-
a = string(a, isempty(m.captures[1]) ? m.captures[2][1] : m.captures[1])
171-
a, String(m.captures[3])
172-
end
173-
end
174-
175148
# Robust across Julia versions
176149
getpkgid(project::AbstractString, libname) = getpkgid(Base.project_deps_get(project, libname), libname)
177150
getpkgid(id::PkgId, libname) = id

test/runtests.jl

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,23 @@ isdefined(Main, :Revise) ? Main.Revise.includet("script.jl") : include("script.j
6565
@test occursin("Float32", src)
6666
@test line == 43
6767

68+
info = CodeTracking.PkgFiles(Base.PkgId(CodeTracking), nothing)
69+
@test isempty(CodeTracking.basedir(info))
70+
71+
info = CodeTracking.PkgFiles(Base.PkgId(CodeTracking), [])
72+
@test length(CodeTracking.srcfiles(info)) == 0
73+
6874
info = CodeTracking.PkgFiles(Base.PkgId(CodeTracking))
6975
@test Base.PkgId(info) === info.id
7076
@test CodeTracking.basedir(info) == dirname(@__DIR__)
7177

72-
io = IOBuffer()
78+
io = PipeBuffer()
7379
show(io, info)
74-
str = String(take!(io))
80+
str = read(io, String)
7581
@test startswith(str, "PkgFiles(CodeTracking [da1fd8a2-8d9e-5ec2-8556-3022fb5608a2]):\n basedir:")
7682
ioctx = IOContext(io, :compact=>true)
7783
show(ioctx, info)
78-
str = String(take!(io))
84+
str = read(io, String)
7985
@test match(r"PkgFiles\(CodeTracking, .*CodeTracking(\.jl)?, Any\[\]\)", str) !== nothing
8086

8187
@test pkgfiles("ColorTypes") === nothing
@@ -98,8 +104,9 @@ isdefined(Main, :Revise) ? Main.Revise.includet("script.jl") : include("script.j
98104
@test whereis(m) == ("REPL[1]", 1)
99105
CodeTracking.method_lookup_callback[] = oldlookup
100106

107+
# Test implicit replacement of `BUILDBOT_STDLIB_PATH`
101108
m = first(methods(Test.eval))
102-
@test occursin(Sys.STDLIB, whereis(m)[1])
109+
@test isfile(whereis(m)[1])
103110

104111
# https://github.com/JuliaDebug/JuliaInterpreter.jl/issues/150
105112
function f150()

0 commit comments

Comments
 (0)