add test for julia install and mtime maintenance (#200)

This commit is contained in:
Ian Butterworth
2024-01-05 12:36:56 -05:00
committed by GitHub
parent 15b8728ec6
commit a46a85f797
5 changed files with 19 additions and 0 deletions

11
.github/scripts/common-tests.jl vendored Normal file
View File

@@ -0,0 +1,11 @@
if !occursin("hostedtoolcache", Sys.BINDIR)
error("the wrong julia is being used: $(Sys.BINDIR)")
end
if VERSION >= v"1.7.0" # pkgdir was introduced here, and before then mtime wasn't a problem so just skip
using Pkg
src = pkgdir(Pkg, "src", "Pkg.jl")
# mtime is when it's compressed, ctime is when the file is extracted
if mtime(src) >= ctime(src)
error("source mtime ($(mtime(src))) is not earlier than ctime ($(ctime(src)))")
end
end

View File

@@ -44,3 +44,5 @@ jobs:
version: ${{ matrix.julia-version }} version: ${{ matrix.julia-version }}
- run: julia --version - run: julia --version
- run: julia --compile=min -O0 -e 'import InteractiveUtils; InteractiveUtils.versioninfo()' - run: julia --compile=min -O0 -e 'import InteractiveUtils; InteractiveUtils.versioninfo()'
- name: "Check that the correct julia is used and that archive mtimes are maintained"
run: julia --startup-file=no --color=yes ./.github/scripts/common-tests.jl

View File

@@ -42,3 +42,5 @@ jobs:
version: ${{ matrix.julia-version }} version: ${{ matrix.julia-version }}
- run: julia --version - run: julia --version
- run: julia --compile=min -O0 -e 'import InteractiveUtils; InteractiveUtils.versioninfo()' - run: julia --compile=min -O0 -e 'import InteractiveUtils; InteractiveUtils.versioninfo()'
- name: "Check that the correct julia is used and that archive mtimes are maintained"
run: julia --startup-file=no --color=yes ./.github/scripts/common-tests.jl

View File

@@ -50,3 +50,5 @@ jobs:
arch: ${{ matrix.julia-arch }} arch: ${{ matrix.julia-arch }}
- run: julia --version - run: julia --version
- run: julia --compile=min -O0 -e 'import InteractiveUtils; InteractiveUtils.versioninfo()' - run: julia --compile=min -O0 -e 'import InteractiveUtils; InteractiveUtils.versioninfo()'
- name: "Check that the correct julia is used and that archive mtimes are maintained"
run: julia --startup-file=no --color=yes ./.github/scripts/common-tests.jl

View File

@@ -50,3 +50,5 @@ jobs:
arch: ${{ matrix.julia-arch }} arch: ${{ matrix.julia-arch }}
- run: julia --version - run: julia --version
- run: julia --compile=min -O0 -e 'import InteractiveUtils; InteractiveUtils.versioninfo()' - run: julia --compile=min -O0 -e 'import InteractiveUtils; InteractiveUtils.versioninfo()'
- name: "Check that the correct julia is used and that archive mtimes are maintained"
run: julia --startup-file=no --color=yes ./.github/scripts/common-tests.jl