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 b789ee5
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 64 deletions.
18 changes: 2 additions & 16 deletions .github/workflows/example-builds-defaultarch.yml
Expand Up @@ -42,19 +42,5 @@ jobs:
uses: ./
with:
version: ${{ matrix.julia-version }}
- 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}

- uses: ./.github/workflows/test-common.yml
19 changes: 3 additions & 16 deletions .github/workflows/example-builds-nightly-defaultarch.yml
Expand Up @@ -40,19 +40,6 @@ jobs:
uses: ./
with:
version: ${{ matrix.julia-version }}
- 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}

- uses: ./.github/workflows/test-common.yml

18 changes: 2 additions & 16 deletions .github/workflows/example-builds-nightly.yml
Expand Up @@ -48,19 +48,5 @@ jobs:
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}
- 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}

- uses: ./.github/workflows/test-common.yml
19 changes: 3 additions & 16 deletions .github/workflows/example-builds.yml
Expand Up @@ -48,19 +48,6 @@ jobs:
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}
- 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}

- uses: ./.github/workflows/test-common.yml

24 changes: 24 additions & 0 deletions .github/workflows/test-common.yml
@@ -0,0 +1,24 @@
name: Common Tests

on:
workflow_call:

jobs:
tests:
steps:
- 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" # 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}

0 comments on commit b789ee5

Please sign in to comment.