Skip to content

Commit

Permalink
Begin test rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHatherly committed Jun 19, 2024
1 parent bb773e8 commit 5002655
Show file tree
Hide file tree
Showing 15 changed files with 122 additions and 2,815 deletions.
161 changes: 4 additions & 157 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,98 +21,15 @@ permissions:
jobs:
finalize:
timeout-minutes: 10
needs: [test-bundle, test-multiversion]
needs: [test]
if: always()
runs-on: ubuntu-latest
steps:
- run: |
echo test-multiversion: ${{ needs.test-multiversion.result }}
echo test-bundle: ${{ needs.test-bundle.result }}
echo test-bundle: ${{ needs.test.result }}
- run: exit 1
if: |
(needs.test-multiversion.result != 'success') ||
(needs.test-bundle.result != 'success')
build-multiversion:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
persist-credentials: false

- uses: julia-actions/install-juliaup@2ad49a51b33d519705c111f7b6fe9d069f356da5
with:
channel: "1.10.2"
- run: juliaup default 1.10.2

- run: julia --project -e 'import Pkg; Pkg.instantiate()'
- run: julia --project -e 'import PackageBundler; PackageBundler.instantiate("test/multiversion/envs")'
- run: julia --project test/multiversion/bundle.jl

- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
with:
name: multiversion
path: test/multiversion/build/CommonMarkStrippedRegistry

test-multiversion:
needs: [build-multiversion]
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
version:
- "1.10.1"
- "1.10.2"
os:
- macos-latest
- ubuntu-latest
- windows-latest

steps:
- uses: julia-actions/setup-julia@f2258781c657ad9b4b88072c5eeaf9ec8c370874
with:
version: ${{ matrix.version }}

- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
with:
name: multiversion
path: multiversion

- name: Initialize Julia Depot
run: julia -e 'import Pkg; Pkg.status()'

- name: Install bundle
run: julia multiversion/registry/install.jl

- name: Installing the same bundle again should uninstall and reinstall
run: julia multiversion/registry/install.jl

- name: Resolve environment and precompile
run: |
julia --project=@CommonMark_${{ matrix.version }} -e '
pushfirst!(LOAD_PATH, "@stdlib")
import Pkg
Pkg.status()
Pkg.resolve()
Pkg.precompile("CommonMark")
'
- name: Load stripped package and check for source stripping
run: julia --project=@CommonMark_${{ matrix.version }} -e 'import CommonMark; @show(first(functionloc(CommonMark.issafe, Tuple{Char}))) === nothing || exit(1)'

- name: Remove bundle
run: |
julia -e '
for depot in DEPOT_PATH
path = joinpath(depot, "registries", "CommonMarkStrippedRegistry", "remove.jl")
if isfile(path)
run(`julia $path`)
break
end
end
'
(needs.test.result != 'success')
test:
runs-on: ${{ matrix.os }}
Expand All @@ -121,7 +38,7 @@ jobs:
fail-fast: false
matrix:
version:
- "1.10.2"
- "1.10"
os:
- macos-latest
- ubuntu-latest
Expand All @@ -134,76 +51,6 @@ jobs:
- uses: julia-actions/install-juliaup@2ad49a51b33d519705c111f7b6fe9d069f356da5
with:
channel: "${{ matrix.version }}"
- run: juliaup default ${{ matrix.version }}
- uses: julia-actions/cache@d48542bb7b6239a9391789f01d21a6bdde9ad5df
- uses: julia-actions/julia-buildpkg@90dd6f23eb49626e4e6612cb9d64d456f86e6a1c
- run: julia --project -e 'import PackageBundler; PackageBundler.instantiate("test/envs")'
- uses: julia-actions/julia-runtest@79a7e100883947123f8263c5f06e6c0ea3eb972f
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
with:
name: bundle-${{ matrix.os }}
path: test/build/LocalCustomRegistry

test-bundle:
needs: [test]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
version:
- "1.10.2"
os:
- macos-latest
- ubuntu-latest
- windows-latest
bundle:
- bundle-macos-latest
- bundle-ubuntu-latest
- bundle-windows-latest

steps:
- uses: julia-actions/setup-julia@f2258781c657ad9b4b88072c5eeaf9ec8c370874
with:
version: ${{ matrix.version }}

- uses: julia-actions/cache@d48542bb7b6239a9391789f01d21a6bdde9ad5df

- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
with:
name: ${{ matrix.bundle }}
path: ${{ matrix.bundle }}

- name: Initialize Julia Depot
run: julia -e 'import Pkg; Pkg.status()'

- name: Install bundle
run: julia ${{ matrix.bundle }}/registry/install.jl

- name: Installing the same bundle again should uninstall and reinstall
run: julia ${{ matrix.bundle }}/registry/install.jl

- name: Resolve environment and precompile
run: |
julia --project=@CustomEnv -e '
pushfirst!(LOAD_PATH, "@stdlib")
import Pkg
Pkg.status()
Pkg.resolve()
Pkg.precompile("CairoMakie")
'
- name: Load packages
run: julia --project=@CustomEnv -e 'import CairoMakie'

- name: Remove bundle
run: |
julia -e '
for depot in DEPOT_PATH
path = joinpath(depot, "registries", "LocalCustomRegistry", "remove.jl")
if isfile(path)
run(`julia $path`)
break
end
end
'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/Manifest.toml
/test/Manifest.toml
/test/packages/**/Manifest.toml
*.pem
*.pub
test/build
Expand Down
5 changes: 1 addition & 4 deletions test/PackageBundler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,4 @@ key = "key"
clean = true

[packages]
"13f3f980-e62b-5c42-98c6-ff1f3baf88f0" = "CairoMakie"
"479239e8-5488-4da2-87a7-35f2df7eef83" = "Catalyst"
"0c46a032-eb83-5123-abaf-570d42b7fbaa" = "DifferentialEquations"
"961ee093-0014-501f-94e3-6117800e7a78" = "ModelingToolkit"
"8346427c-08d3-4941-a1ec-6285c85e2ad6" = "TestPackage"
2 changes: 2 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[deps]
LocalRegistry = "89398ba2-070a-4b16-a995-9893c55d93cf"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Loading

0 comments on commit 5002655

Please sign in to comment.