Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipeline for running mod phpunit test #2542

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
39 changes: 39 additions & 0 deletions Dockerfile.phpunit
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common \
&& apt-get clean \
&& rm -fr /var/lib/apt/lists/*

RUN add-apt-repository ppa:ondrej/php

RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
php5.6 \
php5.6-gd \
php5.6-mbstring \
php5.6-json \
php5.6-mysql \
php5.6-zip \
php5.6-xml \
php5.6-curl \
php5.6-opcache \
php5.6-memcache \
&& apt-get clean \
&& rm -fr /var/lib/apt/lists/*

RUN mkdir /app && mkdir /app/pleio && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

WORKDIR /app
COPY composer.json composer.json /app/
COPY mod/pleio/composer.json /app/pleio/

ARG COMPOSER_ALLOW_SUPERUSER=1
ARG COMPOSER_NO_INTERACTION=1
RUN composer config --no-plugins allow-plugins.composer/installers true
RUN composer install

WORKDIR /app/pleio
RUN composer install

24 changes: 22 additions & 2 deletions azure-pipelines-PR.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
trigger: # don't trigger outside PRs
- none
trigger:
- '*'

pr: # Trigger the pipeline only for PRs targeting master branch
- master
Expand All @@ -15,9 +15,29 @@ pool:
vmImage: 'ubuntu-latest'



jobs:
- job: unittests
displayName: run phpunit tests
container: phanoix/collab-pipeline:latest
steps:
- script: |
rm composer.lock
composer config --no-plugins allow-plugins.composer/installers true
composer install
ls -l
ls -l ./vendor/bin/
cd mod && ../vendor/bin/phpunit --log-junit ../PHPunit_results.xml

- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/PHPunit_results.xml'
testRunTitle: phpunit tests

- job: setup
displayName: build and set up review site
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest')) # don't trigger outside PRs
steps:
- task: Docker@2
displayName: Build and Push Container image to ACR
Expand Down