.gitlab-ci.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # This file is a template, and might need editing before it works on your project.
  2. # To contribute improvements to CI/CD templates, please follow the Development guide at:
  3. # https://docs.gitlab.com/ee/development/cicd/templates.html
  4. # This specific template is located at:
  5. # https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
  6. # This is a sample GitLab CI/CD configuration file that should run without any modifications.
  7. # It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts,
  8. # it uses echo commands to simulate the pipeline execution.
  9. #
  10. # A pipeline is composed of independent jobs that run scripts, grouped into stages.
  11. # Stages run in sequential order, but jobs within stages run in parallel.
  12. #
  13. # For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages
  14. image: registry.gitlab.com/freepascal.org/fpc/source:buster_fpcbuild
  15. stages: # List of stages for jobs, and their order of execution
  16. - build
  17. - test
  18. - deploy
  19. build-job: # This job runs in the build stage, which runs first.
  20. stage: build
  21. script:
  22. - echo "Compiling the code..."
  23. - echo "Compile complete."
  24. unit-test-job: # This job runs in the test stage.
  25. stage: test # It only starts when the job in the build stage completes successfully.
  26. script:
  27. - echo "Running unit tests... This will take about 60 seconds."
  28. - sleep 60
  29. - echo "Code coverage is 90%"
  30. lint-test-job: # This job also runs in the test stage.
  31. stage: test # It can run at the same time as unit-test-job (in parallel).
  32. script:
  33. - echo "Linting code... This will take about 10 seconds."
  34. - sleep 10
  35. - echo "No lint issues found."
  36. deploy-job: # This job runs in the deploy stage.
  37. stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
  38. script:
  39. - echo "Deploying application..."
  40. - echo "Application successfully deployed."