diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d92e3233dfb5ca864f7eed3cfedf344c59cd6967..899bdbad32e0fe174b48d294f537b6f39a462cfd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,8 +20,10 @@ stages: - test - deploy -# Below is the template to run your tests in Julia -.test_template: &test_definition +# Name a test and select an appropriate image. +# images comes from Docker hub +test:1.0: + image: julia:1.0 # Use `docker` runners tags: [ docker ] # Uncomment below if you would like to run the tests on specific @@ -32,8 +34,8 @@ stages: # - development script: # Let's run the tests. Substitute `coverage = false` below, if you - # do not want coverage results. - - julia -e 'using Pkg; Pkg.add(path=pwd()); + # do not want coverage results. Use Pkg.clone for Julia 1.0 + - julia -e 'using Pkg; Pkg.clone(pwd()); Pkg.build("CaosDB"); Pkg.test("CaosDB"; coverage = true)' # Comment out below if you do not want coverage results. @@ -43,14 +45,29 @@ stages: using Coverage; cl, tl = get_summary(process_folder()); println("(", cl/tl*100, "%) covered")' -# Name a test and select an appropriate image. -# images comes from Docker hub -test:1.0: - image: julia:1.0 - <<: *test_definition test:1.6: image: julia:1.6 - <<: *test_definition + # Use `docker` runners + tags: [ docker ] + # Uncomment below if you would like to run the tests on specific + # references only, such as the branches `master`, `development`, + # etc. + # only: + # - master + # - development + script: + # Let's run the tests. Substitute `coverage = false` below, if you + # do not want coverage results. + - julia -e 'using Pkg; Pkg.add(path=pwd()); + Pkg.build("CaosDB"); + Pkg.test("CaosDB"; coverage = true)' + # Comment out below if you do not want coverage results. + - julia -e 'using Pkg; Pkg.add("Coverage"); + import CaosDB; + cd(joinpath(dirname(pathof(CaosDB)), "..")); + using Coverage; cl, tl = get_summary(process_folder()); + println("(", cl/tl*100, "%) covered")' + # REMARK: Do not forget to enable the coverage feature for your # project, if you are using code coverage reporting above. This can be