Skip to content

Commit

Permalink
use a common test file
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Jan 5, 2024
1 parent c8bcd33 commit dcc55a3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 52 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/common-tests.jl
@@ -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
14 changes: 1 addition & 13 deletions .github/workflows/example-builds-defaultarch.yml
Expand Up @@ -45,16 +45,4 @@ jobs:
- run: julia --version
- 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: |
if !occursin("hostedtoolcache", Sys.BINDIR)
error("the wrong julia is being used: $(Sys.BINDIR)")
end
if VERSION > v"1.7.0-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
shell: julia --startup-file=no --color=yes {0}
run: julia --startup-file=no --color=yes ./.github/workflows/common-tests.jl
14 changes: 1 addition & 13 deletions .github/workflows/example-builds-nightly-defaultarch.yml
Expand Up @@ -43,16 +43,4 @@ jobs:
- run: julia --version
- 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: |
if !occursin("hostedtoolcache", Sys.BINDIR)
error("the wrong julia is being used: $(Sys.BINDIR)")
end
if VERSION > v"1.7.0-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
shell: julia --startup-file=no --color=yes {0}
run: julia --startup-file=no --color=yes ./.github/workflows/common-tests.jl
14 changes: 1 addition & 13 deletions .github/workflows/example-builds-nightly.yml
Expand Up @@ -51,16 +51,4 @@ jobs:
- run: julia --version
- 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: |
if !occursin("hostedtoolcache", Sys.BINDIR)
error("the wrong julia is being used: $(Sys.BINDIR)")
end
if VERSION > v"1.7.0-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
shell: julia --startup-file=no --color=yes {0}
run: julia --startup-file=no --color=yes ./.github/workflows/common-tests.jl
14 changes: 1 addition & 13 deletions .github/workflows/example-builds.yml
Expand Up @@ -51,16 +51,4 @@ jobs:
- run: julia --version
- 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: |
if !occursin("hostedtoolcache", Sys.BINDIR)
error("the wrong julia is being used: $(Sys.BINDIR)")
end
if VERSION > v"1.7.0-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
shell: julia --startup-file=no --color=yes {0}
run: julia --startup-file=no --color=yes ./.github/workflows/common-tests.jl

0 comments on commit dcc55a3

Please sign in to comment.