From e34b23c952920014900aeffece3787abd9376985 Mon Sep 17 00:00:00 2001 From: victor Date: Mon, 27 Jan 2025 15:17:18 +0100 Subject: [PATCH 1/2] update tests --- .github/workflows/{CI.yml => Tests.yml} | 11 +++++++---- test/runtests.jl | 23 +++++++++++++++++++---- 2 files changed, 26 insertions(+), 8 deletions(-) rename .github/workflows/{CI.yml => Tests.yml} (84%) diff --git a/.github/workflows/CI.yml b/.github/workflows/Tests.yml similarity index 84% rename from .github/workflows/CI.yml rename to .github/workflows/Tests.yml index 46000be..d9c46cb 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/Tests.yml @@ -1,4 +1,4 @@ -name: CI +name: Tests on: push: branches: @@ -20,16 +20,19 @@ jobs: matrix: version: - 'lts' + group: + - spaces + - ising + - finalize os: - ubuntu-latest - arch: - - x64 + - macOS-latest + - windows-latest steps: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - uses: julia-actions/cache@v2 - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest diff --git a/test/runtests.jl b/test/runtests.jl index c96c094..cbf99aa 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2,8 +2,23 @@ using Test using TNRKit using TensorKit -using QuadGK +# check if user supplied args +pat = r"(?:--group=)(\w+)" +arg_id = findfirst(contains(pat), ARGS) +const GROUP = if isnothing(arg_id) + uppercase(get(ENV, "GROUP", "ALL")) +else + uppercase(only(match(pat, ARGS[arg_id]).captures)) +end -include("spaces.jl") # do they give spacemismatches? -include("ising.jl") # do they give the correct results (with the expected accuracy)? -include("finalize.jl") # do they give the correct results (with the expected accuracy)? +@time begin + if GROUP == "ALL" || GROUP == "SPACES" + @time include("spaces.jl") # do they give spacemismatches? + end + if GROUP == "ALL" || GROUP == "ISING" + @time include("ising.jl") # do they give the correct results (with the expected accuracy)? + end + if GROUP == "ALL" || GROUP == "FINALIZE" + @time include("finalize.jl") # do they give the correct results (with the expected accuracy)? + end +end \ No newline at end of file From 836781c53e6bdc62919934477cddde0a77adc3a1 Mon Sep 17 00:00:00 2001 From: victor Date: Mon, 27 Jan 2025 15:20:19 +0100 Subject: [PATCH 2/2] format --- .github/workflows/Tests.yml | 2 +- test/runtests.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index d9c46cb..ea43b7f 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -13,7 +13,7 @@ concurrency: jobs: test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.group }} runs-on: ${{ matrix.os }} strategy: fail-fast: false diff --git a/test/runtests.jl b/test/runtests.jl index cbf99aa..2bc7f62 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -21,4 +21,4 @@ end if GROUP == "ALL" || GROUP == "FINALIZE" @time include("finalize.jl") # do they give the correct results (with the expected accuracy)? end -end \ No newline at end of file +end