I have a project where I'd like to use GitLab CI to automate the following:
- Confirm that commit at the HEAD of each pushed feature branch passes the tests.
- Confirm that each commit within a pushed feature branch properly compiles.
So far I've solved 1 by creating a simple job called my_test_job
that successfully runs my tests on every branch push using mvn verify
.
How can I solve 2? The command to build the project is mvn package
, but I don't know how to have this run on every commit of a pushed branch.
My current gitlab-ci.yml file:
image: maven:3.3.3-jdk-8
stages:
- test
my_test_job:
script: mvn verify
tl;dr - I'd like GitLab CI to confirm that each commit within a pushed feature branch compiles without error.
Thanks!