Use GitHub Actions for running tests/builds

This commit is contained in:
Ben Ramsey
2021-09-28 12:00:54 -05:00
parent 9ba77bc727
commit c3b7b86f78
4 changed files with 120 additions and 45 deletions

View File

@@ -0,0 +1,114 @@
# GitHub Actions Documentation: https://docs.github.com/en/actions
name: "build"
on: ["pull_request", "push"]
jobs:
ubuntu:
name: "Test on Ubuntu"
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
php-version:
- "5.4"
- "5.5"
- "5.6"
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
steps:
- name: "Install dependencies"
run: |
sudo apt-get update
sudo apt-get install -y re2c
- name: "Checkout repository"
uses: "actions/checkout@v2"
- name: "Setup PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
coverage: "none"
tools: "phpize, php-config"
- name: "Generate build files"
run: "phpize"
- name: "Configure build"
run: "./configure --enable-uploadprogress"
- name: "Build"
run: "make"
- name: "Run tests"
run: |
export TEST_PHP_ARGS="-n -d extension=modules/uploadprogress.so"
php run-tests.php -P --show-diff tests
windows:
name: "Test on Windows"
runs-on: "windows-latest"
defaults:
run:
shell: "cmd"
strategy:
fail-fast: false
matrix:
php-version:
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
arch:
- "x64"
- "x86"
ts:
- "ts"
- "nts"
steps:
- name: "Configure Git"
run: "git config --system core.autocrlf false"
- name: "Checkout repository"
uses: "actions/checkout@v2"
- name: "Setup PHP"
id: "setup-php"
uses: "cmb69/setup-php-sdk@v0.2"
with:
version: "${{ matrix.php-version }}"
arch: "${{ matrix.arch }}"
ts: "${{ matrix.ts }}"
- name: "Enable developer command prompt"
uses: "ilammy/msvc-dev-cmd@v1"
with:
arch: "${{ matrix.arch }}"
toolset: "${{ steps.setup-php.outputs.toolset }}"
- name: "Generate build files"
run: "phpize"
- name: "Configure build"
run: "configure --enable-uploadprogress --with-prefix=${{ steps.setup-php.outputs.prefix }}"
- name: "Build"
run: "nmake"
- name: "Run tests"
run: nmake test TESTS="--show-diff tests"

12
.gitignore vendored
View File

@@ -27,9 +27,9 @@ missing
mkinstalldirs
modules
run-tests.php
tests/*/*.diff
tests/*/*.out
tests/*/*.php
tests/*/*.exp
tests/*/*.log
tests/*/*.sh
tests/**/*.diff
tests/**/*.out
tests/**/*.php
tests/**/*.exp
tests/**/*.log
tests/**/*.sh

View File

@@ -1,19 +0,0 @@
language: php
jobs:
fast_finish: true
include:
- php: 5.4
dist: trusty
- php: 5.5
dist: trusty
- php: 5.6
- php: 7.0
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.4
- php: nightly
script:
- ./tests/build.sh

View File

@@ -1,20 +0,0 @@
#!/bin/bash
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
set -ex
cd "${dir}/../"
php_path=${PHP_BIN_PATH:-$(dirname "$(which php)")}
"${php_path}/phpize"
./configure --with-php-config="${php_path}/php-config"
make
make install
"${php_path}/php" run-tests.php \
-q \
-p "${php_path}/php" \
-d extension=$(pwd)/modules/uploadprogress.so \
-g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" \
--show-diff \
--offline \
--set-timeout 120