debian-mirror-gitlab/lib/gitlab/ci/templates/Julia.gitlab-ci.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

84 lines
3.5 KiB
YAML
Raw Normal View History

2018-12-05 23:21:45 +05:30
# This is an example .gitlab-ci.yml file to test (and optionally report the coverage
2016-11-03 12:29:30 +05:30
# results of) your [Julia][1] packages. Please refer to the [documentation][2]
# for more information about package development in Julia.
#
# Here, it is assumed that your Julia package is named `MyPackage`. Change it to
# whatever name you have given to your package.
#
# [1]: http://julialang.org/
2018-12-05 23:21:45 +05:30
# [2]: https://docs.julialang.org/en/v1/manual/documentation/index.html
2022-08-13 15:12:31 +05:30
#
# You can copy and paste this template into a new `.gitlab-ci.yml` file.
# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword.
#
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Julia.gitlab-ci.yml
2016-11-03 12:29:30 +05:30
# Below is the template to run your tests in Julia
.test_template: &test_definition
2021-04-17 20:07:23 +05:30
# Uncomment below (and adjust as needed) to run the tests for specific references
# only, such as the default branch, a `development` branch, and so on:
# rules:
# - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# - if: $CI_COMMIT_BRANCH == "development"
2016-11-03 12:29:30 +05:30
script:
# Let's run the tests. Substitute `coverage = false` below, if you do not
# want coverage results.
2018-12-05 23:21:45 +05:30
- julia -e 'using Pkg; Pkg.clone(pwd()); Pkg.build("MyPackage"); Pkg.test("MyPackage"; coverage = true)'
2016-11-03 12:29:30 +05:30
# Comment out below if you do not want coverage results.
2019-09-04 21:01:54 +05:30
- julia -e 'using Pkg; Pkg.add("Coverage");
2018-12-05 23:21:45 +05:30
import MyPackage; cd(joinpath(dirname(pathof(MyPackage)), ".."));
2016-11-03 12:29:30 +05:30
using Coverage; cl, tl = get_summary(process_folder());
println("(", cl/tl*100, "%) covered")'
# Name a test and select an appropriate image.
2018-12-05 23:21:45 +05:30
# images comes from Docker hub
test:0.7:
image: julia:0.7
<<: *test_definition
2019-07-07 11:18:12 +05:30
2018-12-05 23:21:45 +05:30
test:1.0:
image: julia:1.0
2016-11-03 12:29:30 +05:30
<<: *test_definition
# Maybe you would like to test your package against the development branch:
2018-12-05 23:21:45 +05:30
# test:1.1-dev (not sure there is such an image in docker, so not tested yet):
# image: julia:v1.1-dev
# # ... allowing for failures, since we are testing against the development
# # branch:
# allow_failure: true
# <<: *test_definition
2016-11-03 12:29:30 +05:30
# REMARK: Do not forget to enable the coverage feature for your project, if you
# are using code coverage reporting above. This can be done by
#
# - Navigating to the `CI/CD Pipelines` settings of your project,
# - Copying and pasting the default `Simplecov` regex example provided, i.e.,
# `\(\d+.\d+\%\) covered` in the `test coverage parsing` textfield.
2018-12-05 23:21:45 +05:30
# Example documentation deployment
pages:
image: julia:0.7
stage: deploy
script:
2019-09-04 21:01:54 +05:30
- apt-get update -qq && apt-get install -y git # needed by Documenter
- julia -e 'using Pkg; Pkg.clone(pwd()); Pkg.build("MyPackage");' # rebuild Julia (can be put somewhere else I'm sure
- julia -e 'using Pkg; import MyPackage; Pkg.add("Documenter")' # install Documenter
- julia --color=yes docs/make.jl # make documentation
- mv docs/build public # move to the directory picked up by Gitlab pages
2018-12-05 23:21:45 +05:30
artifacts:
paths:
- public
2021-04-17 20:07:23 +05:30
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
2018-12-05 23:21:45 +05:30
# WARNING: This template is using the `julia` images from [Docker
2016-11-03 12:29:30 +05:30
# Hub][3]. One can use custom Julia images and/or the official ones found
# in the same place. However, care must be taken to correctly locate the binary
# file (`/opt/julia/bin/julia` above), which is usually given on the image's
# description page.
#
2018-12-05 23:21:45 +05:30
# [3]: https://hub.docker.com/_/julia/