Hi guys, Is that possible to be done in pipeline?
On push we need to run phpunit and if the tests are failing we need to block the merge button.
Below is my simple pipeline:
steps: - step: &build name: Build and run Composer runs-on: - 'self.hosted' - 'linux.arm64' - 'customlabel' script: - apt update - apt install -y list-of-packages - docker-php-ext-enable list-of-extensions - docker-php-ext-install list-of-extentions - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer - composer install - ./vendor/bin/phpstan - ./vendor/bin/phpunit - apt-get clean - rm -rf /var/lib/apt/lists/* /tmp/pear caches: - composer pipelines: branches: my-branch: - step: *build
Regards,
Hi @Ivo,
Yes, when your test fails and causes the pipeline to fail, it will mark the build as failed. You can define merge checks for passing builds.
We also provide an addon with build checks and additional merge checks not available on Bitbucket out of the box.
Thank you @Saxea _Flowie_
We know about the merge checks and the options but my colleagues are not able to merge:
The message is:
The following recommended pre-merge check did not pass:
1+ approval from default reviewers
They selected from the merge settings
Minimum number of approvals 1
Minimum number of successful builds for the last commit with no failed builds and no in progress builds 1
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you also selected 'Prevent a merge with unresolved merge checks'?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Saxea _Flowie_ ,
No i haven't selected this option because this option is part of the Premium plan.
You can see my configuration on the screenshot below.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In order to block the merge using Bitbucket's built in checks you need premium. Flowie can enforce merge checks on non-premium, but is also a paid addon. It does give you other functionality like PR labels, draft, additional checks, rebase support and more.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.