## Continuous Integration

Consider an application that has its code stored in a Git repository in GitLab. Developers push code changes every day, multiple times a day. For every push to the repository, you can create a set of scripts to build and test your application automatically. These scripts help decrease the chances that you introduce errors in your application.

This practice is known as Continuous Integration. Each change submitted to an application, even to development branches, is built and tested automatically and continuously. These tests ensure the changes pass all tests, guidelines, and code compliance standards you established for your application.

GitLab itself is an example of a project that uses Continuous Integration as a software development method.

sample code:

```yaml
image: node:16

cache:
  paths:
    - node_modules/

before_script:
  - npm install

lint:
  script:
    - npm run lint

test:
  script:
    - npm run test
  artifacts:
    when: always
    reports:
      cobertura: coverage/cobertura-coverage.xml
      junit: junit.xml
  coverage: '/All files[^|]*\|[^|]*\s+([\d\.]+)/'
```

https://docs.gitlab.com/ee/ci/
