diff --git a/Dockerfile.phpunit b/Dockerfile.phpunit new file mode 100644 index 0000000000..77e5ed2013 --- /dev/null +++ b/Dockerfile.phpunit @@ -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 + diff --git a/azure-pipelines-PR.yaml b/azure-pipelines-PR.yaml index f72168e45b..365058cd2e 100644 --- a/azure-pipelines-PR.yaml +++ b/azure-pipelines-PR.yaml @@ -1,5 +1,5 @@ -trigger: # don't trigger outside PRs -- none +trigger: +- '*' pr: # Trigger the pipeline only for PRs targeting master branch - master @@ -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