diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..d24301b --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,52 @@ +stages: + - unit-test + +.untit_test_template: + stage: unit-test + script: + - apt update && apt install -y git + - julia --project=. -e 'import Pkg; Pkg.instantiate()' + - julia --project=. -e 'import Pkg; Pkg.test(; coverage = true)' + interruptible: true + tags: + - cpuonly + +unit_tests_releases: + extends: .untit_test_template + parallel: + matrix: + - JULIA_VERSION: ["1.6", "1.7", "1.8", "1.9", "1.10"] + 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 diff --git a/src/QEDcore.jl b/src/QEDcore.jl index c2f5cc7..e44697d 100644 --- a/src/QEDcore.jl +++ b/src/QEDcore.jl @@ -2,4 +2,8 @@ module QEDcore # Write your package code here. +function greet(x) + return "Hello $x" +end + end diff --git a/test/runtests.jl b/test/runtests.jl index 2290068..cf60087 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2,5 +2,7 @@ using QEDcore using Test @testset "QEDcore.jl" begin - # Write your tests here. + @testset "dummy" begin + @test QEDcore.greet("World!") == "Hello World!" + end end