]> granicus.if.org Git - php/commitdiff
Set up CI with Azure Pipelines
authorJoe Watkins <krakjoe@php.net>
Wed, 29 May 2019 15:59:36 +0000 (17:59 +0200)
committerJoe Watkins <krakjoe@php.net>
Mon, 3 Jun 2019 20:27:50 +0000 (22:27 +0200)
azure-pipelines.yml [new file with mode: 0644]
azure/apt.yml [new file with mode: 0644]
azure/job.yml [new file with mode: 0644]
azure/test.yml [new file with mode: 0644]

diff --git a/azure-pipelines.yml b/azure-pipelines.yml
new file mode 100644 (file)
index 0000000..1803a58
--- /dev/null
@@ -0,0 +1,21 @@
+trigger:
+  - 7.4
+  - master
+
+jobs:
+  - template: azure/job.yml
+    parameters:
+      configurationName: RELEASE_NTS
+      configurationParameters: '--disable-debug --disable-zts'
+  - template: azure/job.yml
+    parameters:
+      configurationName: DEBUG_NTS
+      configurationParameters: '--enable-debug --disable-zts'
+  - template: azure/job.yml
+    parameters:
+      configurationName: RELEASE_ZTS
+      configurationParameters: '--disable-debug --enable-zts'
+  - template: azure/job.yml
+    parameters:
+      configurationName: DEBUG_ZTS
+      configurationParameters: '--enable-debug --enable-zts'
diff --git a/azure/apt.yml b/azure/apt.yml
new file mode 100644 (file)
index 0000000..ba97531
--- /dev/null
@@ -0,0 +1,35 @@
+parameters:
+  packages: ''
+
+steps:
+  - script: |
+      sudo apt-get update -y | true
+      sudo apt install bison \
+                       re2c \
+                       locales \
+                       language-pack-de \
+                       re2c \
+                       libgmp-dev \
+                       libicu-dev \
+                       libtidy-dev \
+                       libenchant-dev \
+                       libaspell-dev \
+                       libpspell-dev \
+                       librecode-dev \
+                       libsasl2-dev \
+                       libxpm-dev \
+                       libzip-dev \
+                       libsqlite3-dev \
+                       libwebp-dev \
+                       libonig-dev \
+                       libkrb5-dev \
+                       libgssapi-krb5-2 \
+                       libcurl4-openssl-dev \
+                       libxml2-dev \
+                       libxslt1-dev \
+                       libpq-dev \
+                       libreadline-dev \
+                       postgresql \
+                       postgresql-contrib \
+                       ${{ parameters.packages }}
+    displayName: 'APT'
diff --git a/azure/job.yml b/azure/job.yml
new file mode 100644 (file)
index 0000000..432b17a
--- /dev/null
@@ -0,0 +1,92 @@
+parameters:
+  configurationName: ''
+  configurationParameters: ''
+
+jobs:
+  - job: ${{ parameters.configurationName }}
+    pool:
+      vmImage: 'ubuntu-latest'
+    steps:
+    - checkout: self
+      fetchDepth: 1
+    - template: apt.yml
+    - script: |
+        ./buildconf --force
+        ./configure ${{ parameters.configurationParameters }} \
+            --prefix=/usr \
+            --enable-phpdbg \
+            --enable-fpm \
+            --with-pdo-mysql=mysqlnd \
+            --with-mysqli=mysqlnd \
+            --with-pgsql \
+            --with-pdo-pgsql \
+            --with-pdo-sqlite \
+            --enable-intl \
+            --without-pear \
+            --enable-gd \
+            --with-jpeg \
+            --with-webp \
+            --with-freetype \
+            --with-xpm \
+            --enable-exif \
+            --with-zip \
+            --with-zlib \
+            --with-zlib-dir=/usr \
+            --enable-soap \
+            --enable-xmlreader \
+            --with-xsl \
+            --with-tidy \
+            --with-xmlrpc \
+            --enable-sysvsem \
+            --enable-sysvshm \
+            --enable-shmop \
+            --enable-pcntl \
+            --with-readline \
+            --enable-mbstring \
+            --with-curl \
+            --with-gettext \
+            --enable-sockets \
+            --with-bz2 \
+            --with-openssl \
+            --with-gmp \
+            --enable-bcmath \
+            --enable-calendar \
+            --enable-ftp \
+            --with-pspell=/usr \
+            --with-enchant=/usr \
+            --with-kerberos \
+            --enable-sysvmsg \
+            --with-ffi \
+            --enable-zend-test=shared \
+            --enable-werror \
+            --with-config-file-path=/etc \
+            --with-config-file-scan-dir=/etc/php.d
+      displayName: 'Configure Build'
+    - script: make -j$(/usr/bin/nproc) >/dev/null
+      displayName: 'Make Build'
+    - script: |
+        sudo make install
+        sudo mkdir     /etc/php.d
+        sudo chmod 777 /etc/php.d
+        echo mysqli.default_socket=/var/run/mysqld/mysqld.sock     > /etc/php.d/mysqli.ini
+        echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock  > /etc/php.d/pdo_mysql.ini
+      displayName: 'Install Build'
+    - script: |
+        mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
+        sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
+        sudo -u postgres psql -c "CREATE DATABASE test;"
+      displayName: 'Setup'
+    - template: test.yml
+      parameters:
+        configurationName: ${{ parameters.configurationName }}
+    - template: test.yml
+      parameters:
+        configurationName: ${{ parameters.configurationName }}
+        runTestsName: 'OpCache'
+        runTestsParameters: -dopcache.enable_cli=1
+    - ${{ if ne(variables['Build.SourceBranch'], 'refs/heads/7.4') }}:
+      - template: test.yml
+        parameters:
+          configurationName: ${{ parameters.configurationName }}
+          runTestsName: 'JIT'
+          runTestsParameters: -dopcache.enable_cli=1 -dopcache.jit_buffer_size=16M
diff --git a/azure/test.yml b/azure/test.yml
new file mode 100644 (file)
index 0000000..11a1806
--- /dev/null
@@ -0,0 +1,30 @@
+parameters:
+  runTestsName: ''
+  runTestsParameters: ''
+
+steps:
+  - script: |
+      export MYSQL_TEST_USER=root
+      export MYSQL_TEST_PASSWD=root
+      export PDO_MYSQL_TEST_DSN="mysql:host=localhost;dbname=test"
+      export PDO_MYSQL_TEST_USER=root
+      export PDO_MYSQL_TEST_PASS=root
+      export TEST_PHP_JUNIT=junit.xml
+      export REPORT_EXIT_STATUS=no
+      export SKIP_IO_CAPTURE_TESTS=1
+      rm -rf junit.xml | true
+      php run-tests.php -P -q \
+          -j$(/usr/bin/nproc) \
+          -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP \
+          --offline \
+          --show-slow 1000 \
+          --set-timeout 120 \
+          ${{ parameters.runTestsParameters }}
+    displayName: 'Test ${{ parameters.configurationName }} ${{ parameters.runTestsName }}'
+  - task: PublishTestResults@2
+    inputs:
+      testResultsFormat: 'JUnit'
+      testResultsFiles: junit.xml
+      testRunTitle: '${{ parameters.configurationName }} ${{ parameters.runTestsName }}'
+      failTaskOnFailedTests: true
+    displayName: 'Export ${{ parameters.configurationName }} ${{ parameters.runTestsName }} Results'