From 7588afeb022f4d8ba25d030f93e4a1ffb83931c9 Mon Sep 17 00:00:00 2001 From: Simeon Ehrig Date: Tue, 2 Jul 2024 13:48:19 +0200 Subject: [PATCH] run Unit tests with Julia 1.6 until 1.10 and nightly build (#17) Co-authored-by: Anton Reinhard --- .ci/integTestGen/test/runtests.jl | 3 +- .gitlab-ci.yml | 47 ++++++++++++++++++++++++++++--- Project.toml | 2 +- 3 files changed, 46 insertions(+), 6 deletions(-) diff --git a/.ci/integTestGen/test/runtests.jl b/.ci/integTestGen/test/runtests.jl index a561cdb..72cc6bb 100644 --- a/.ci/integTestGen/test/runtests.jl +++ b/.ci/integTestGen/test/runtests.jl @@ -6,7 +6,8 @@ import Term.Trees: Tree import PkgDependency.PkgTree # set environment variable PRINTTREE=on to visualize the project trees of the testsets -printTree::Bool = haskey(ENV, "PRINTTREE") +# TODO(SimeonEhrig): add type ::Bool , when minimum version is Julia 1.9 +printTree = haskey(ENV, "PRINTTREE") @testset "direct dependency to main" begin project_tree = [PkgTree("MyMainProject.jl 1.0.0", [PkgTree("MyDep1.jl 1.0.0", [])])] diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8141c4b..c4a14f5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,8 +2,7 @@ stages: - unit-test - verify-unit-test-deps -unit_tests_julia1.9: - image: julia:1.9 +.untit_test_template: stage: unit-test script: # test SetupDevEnv.jl @@ -32,8 +31,48 @@ unit_tests_julia1.9: tags: - cpuonly -verify-unit-test-deps_julia1.9: - image: julia:1.9 +unit_tests_releases: + extends: .untit_test_template + parallel: + matrix: + - JULIA_VERSION: ["1.6", "1.7", "1.8", "1.9", "1.10", "rc"] + image: julia:$JULIA_VERSION + +unit_tests_nightly: + extends: .untit_test_template + # use the same baseimage like the official julia images + image: debian:bookworm-slim + variables: + # path where julia tar bal should be downloaded + JULIA_DONWLOAD: /julia/download + # path where julia should be extracted + JULIA_EXTRACT: /julia/extract + before_script: + - apt update && apt install -y wget + - mkdir -p $JULIA_DONWLOAD + - mkdir -p $JULIA_EXTRACT + - > + if [[ $CI_RUNNER_EXECUTABLE_ARCH == "linux/arm64" ]]; then + wget https://julialangnightlies-s3.julialang.org/bin/linux/aarch64/julia-latest-linux-aarch64.tar.gz -O $JULIA_DONWLOAD/julia-nightly.tar.gz + elif [[ $CI_RUNNER_EXECUTABLE_ARCH == "linux/amd64" ]]; then + wget https://julialangnightlies-s3.julialang.org/bin/linux/x86_64/julia-latest-linux-x86_64.tar.gz -O $JULIA_DONWLOAD/julia-nightly.tar.gz + else + echo "unknown runner architecture -> $CI_RUNNER_EXECUTABLE_ARCH" + exit 1 + fi + - tar -xf $JULIA_DONWLOAD/julia-nightly.tar.gz -C $JULIA_EXTRACT + # we need to search for the julia base folder name, because the second part of the name is the git commit hash + # e.g. julia-b0c6781676f + - JULIA_EXTRACT_FOLDER=${JULIA_EXTRACT}/$(ls $JULIA_EXTRACT | grep -m1 julia) + # copy everything to /usr to make julia public available + # mv is not possible, because it cannot merge folder + - cp -r $JULIA_EXTRACT_FOLDER/* /usr + allow_failure: true + tags: + - cpuonly + +verify-unit-test-deps: + image: julia:1.10 stage: verify-unit-test-deps script: - > diff --git a/Project.toml b/Project.toml index d03c4bc..ac0d59c 100644 --- a/Project.toml +++ b/Project.toml @@ -16,4 +16,4 @@ QEDfields = "ac3a6c97-e859-4b9f-96bb-63d2a216042c" QEDprocesses = "46de9c38-1bb3-4547-a1ec-da24d767fdad" [compat] -julia = "1.9" +julia = "1.6"