Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
Homework_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ovchinnikov mihail
Homework_project
Merge requests
!7
Dev
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Dev
dev
into
staging
Overview
0
Commits
27
Pipelines
2
Changes
6
Merged
Dev
ovchinnikov mihail
requested to merge
dev
into
staging
Jan 4, 2024
Overview
0
Commits
27
Pipelines
2
Changes
6
0
0
Merge request reports
Compare
staging
staging (base)
and
latest version
latest version
ae3bec58
27 commits,
Jan 4, 2024
6 files
+
298
−
11
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
6
.gitlab-ci.yml
+
23
−
11
View file @ ae3bec58
Edit in single-file editor
Open in Web IDE
Show full file
@@ -16,6 +16,8 @@
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
image
:
gcc:7.3.0
stages
:
# List of stages for jobs, and their order of execution
-
build
-
test
@@ -25,25 +27,35 @@ build-job: # This job runs in the build stage, which runs first.
stage
:
build
script
:
-
echo "Compiling the code..."
-
g++ quadratic_equation.cpp test.cpp main.cpp
-
echo "Compile complete."
rules
:
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == 'staging' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == 'main'
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == 'dev' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == 'staging'
-
if
:
$CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == 'dev'
unit-test-job
:
# This job runs in the test stage.
stage
:
test
# It only starts when the job in the build stage completes successfully.
script
:
-
echo "Running unit tests... This will take about 60 seconds."
-
sleep
60
-
echo "Code coverage is 90%"
lint-test-job
:
# This job also runs in the test stage.
stage
:
test
# It can run at the same time as unit-test-job (in parallel).
script
:
-
echo "Linting code... This will take about 10 seconds."
-
sleep
10
-
echo "No lint issues found."
-
echo "Running unit tests..."
-
g++ quadratic_equation.cpp test.cpp main.cpp -o exec_file
-
./exec_file test
-
echo "Unit tests complete"
rules
:
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == 'staging' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == 'main'
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == 'dev' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == 'staging'
-
if
:
$CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == 'dev'
deploy-job
:
# This job runs in the deploy stage.
stage
:
deploy
# It only runs when *both* jobs in the test stage complete successfully.
environment
:
production
script
:
-
echo "Deploying application..."
-
g++ quadratic_equation.cpp test.cpp main.cpp -o exec_file
-
echo "Application successfully deployed."
artifacts
:
paths
:
-
exec_file
rules
:
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == 'staging' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == 'main'
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == 'dev' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == 'staging'
\ No newline at end of file
Loading