The beginner user of the Hitlab, please do not kick with your feet, I'm interested in testing java-projects on the machine, that is, I wrote the tests I threw in the project on the guitar, and they work on the machine

where to start, how to do it, where to look, where to dig? In general, I will be grateful for any information.

    2 answers 2

    There are three independent tasks:

    1. Write the tests themselves and implement the ability to run them from the command line. You can just command, you can wrap in .sh . The main thing: the tests should really fail when you start, that is:
      • If the tests are successful, the test launcher returns 0 .
      • If tests fail, the launcher returns anything else.
    2. Install and configure GitLab CI Runner on the machine with the OS you need. If you use gitlab.com, you can use the runners provided by GitLab.
      • Then set up your repository for this runner.
    3. Add the .gitlab-ci.yml file to the project root folder. This is the file in the Yaml markup, it describes the pipeline of the project assembly. If GitLab sees this file in a commit, it tries to start the build.

    The content of .gitlab-ci.yml approximately

     # если используем Docker-runner # то, например, такой образ Java можно использовать image: openjdk:7 # у нас будет только один этап сборки — тест stages: - test # и в нём только одна задача test_job: stage: test script: # предположим, что тесты мы запускаем с помощью Maven - mvn test 

      You need to read the documentation for setting up the .gitlab-ci.yml file.

      He runs the runners to perform tasks at a commit or merge, depending on his settings.

      https://docs.gitlab.com/ce/ci/yaml/

      You will also need to configure the runner itself (at the beginning you can on the same machine as gitlab)
      https://docs.gitlab.com/runner/