Skip to content

Commit 86e3f12

Browse files
add test for julia install and mtime maintenance
1 parent 15b8728 commit 86e3f12

File tree

4 files changed

+58
-0
lines changed

4 files changed

+58
-0
lines changed

.github/workflows/example-builds-defaultarch.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,17 @@ jobs:
4444
version: ${{ matrix.julia-version }}
4545
- run: julia --version
4646
- run: julia --compile=min -O0 -e 'import InteractiveUtils; InteractiveUtils.versioninfo()'
47+
- name: "Check that the correct julia is used and that archive mtimes are maintained"
48+
run: |
49+
if !occursin("hostedtoolcache", Sys.BINDIR)
50+
error("the wrong julia is being used: $Sys.BINDIR")
51+
end
52+
if VERSION > v"1.7.0-0" # pkgdir was introduced here, and before then mtime wasn't a problem so just skip
53+
using Pkg
54+
src = pkgdir(Pkg, "src", "Pkg.jl")
55+
# mtime is when it's compacted, ctime is when the file is extracted
56+
if !<(mtime(src), ctime(src))
57+
error("source mtime ($(mtime(src))) is not earlier than ctime ($(ctime(src)))")
58+
end
59+
end
60+
shell: julia --startup-file=no --color=yes {0}

.github/workflows/example-builds-nightly-defaultarch.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,17 @@ jobs:
4242
version: ${{ matrix.julia-version }}
4343
- run: julia --version
4444
- run: julia --compile=min -O0 -e 'import InteractiveUtils; InteractiveUtils.versioninfo()'
45+
- name: "Check that the correct julia is used and that archive mtimes are maintained"
46+
run: |
47+
if !occursin("hostedtoolcache", Sys.BINDIR)
48+
error("the wrong julia is being used: $Sys.BINDIR")
49+
end
50+
if VERSION > v"1.7.0-0" # pkgdir was introduced here, and before then mtime wasn't a problem so just skip
51+
using Pkg
52+
src = pkgdir(Pkg, "src", "Pkg.jl")
53+
# mtime is when it's compacted, ctime is when the file is extracted
54+
if !<(mtime(src), ctime(src))
55+
error("source mtime ($(mtime(src))) is not earlier than ctime ($(ctime(src)))")
56+
end
57+
end
58+
shell: julia --startup-file=no --color=yes {0}

.github/workflows/example-builds-nightly.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,19 @@ jobs:
5050
arch: ${{ matrix.julia-arch }}
5151
- run: julia --version
5252
- run: julia --compile=min -O0 -e 'import InteractiveUtils; InteractiveUtils.versioninfo()'
53+
- name: "Check that the correct julia is used"
54+
run: julia -e 'occursin("hostedtoolcache", Sys.BINDIR) || error()'
55+
- name: "Check that the correct julia is used and that archive mtimes are maintained"
56+
run: |
57+
if !occursin("hostedtoolcache", Sys.BINDIR)
58+
error("the wrong julia is being used: $Sys.BINDIR")
59+
end
60+
if VERSION > v"1.7.0-0" # pkgdir was introduced here, and before then mtime wasn't a problem so just skip
61+
using Pkg
62+
src = pkgdir(Pkg, "src", "Pkg.jl")
63+
# mtime is when it's compacted, ctime is when the file is extracted
64+
if !<(mtime(src), ctime(src))
65+
error("source mtime ($(mtime(src))) is not earlier than ctime ($(ctime(src)))")
66+
end
67+
end
68+
shell: julia --startup-file=no --color=yes {0}

.github/workflows/example-builds.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,17 @@ jobs:
5050
arch: ${{ matrix.julia-arch }}
5151
- run: julia --version
5252
- run: julia --compile=min -O0 -e 'import InteractiveUtils; InteractiveUtils.versioninfo()'
53+
- name: "Check that the correct julia is used and that archive mtimes are maintained"
54+
run: |
55+
if !occursin("hostedtoolcache", Sys.BINDIR)
56+
error("the wrong julia is being used: $Sys.BINDIR")
57+
end
58+
if VERSION > v"1.7.0-0" # pkgdir was introduced here, and before then mtime wasn't a problem so just skip
59+
using Pkg
60+
src = pkgdir(Pkg, "src", "Pkg.jl")
61+
# mtime is when it's compacted, ctime is when the file is extracted
62+
if !<(mtime(src), ctime(src))
63+
error("source mtime ($(mtime(src))) is not earlier than ctime ($(ctime(src)))")
64+
end
65+
end
66+
shell: julia --startup-file=no --color=yes {0}

0 commit comments

Comments
 (0)