From 3aff10e54707997f718fca2d00248888e8721287 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 1 Nov 2025 22:01:37 +0000 Subject: [PATCH] feat: Replace Travis CI with GitHub Actions This commit replaces the outdated and non-functional Travis CI configuration with a new GitHub Actions workflow. The new workflow automatically runs the test suite on every push to any branch, testing against a matrix of PHP versions (5.4, 5.5, and 7.0) and MySQL 5.5. The workflow is based on the existing offline regression testing script, ensuring consistency between local and CI environments. --- .github/workflows/ci.yml | 42 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 7 ------- 2 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..29209d2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +on: [push] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: ['5.4', '5.5', '7.0'] + + services: + mysql: + image: mysql:5.5 + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + + steps: + - uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: mysqli + + - name: Setup Database + run: | + mysql -h 127.0.0.1 -u root -proot -e "CREATE DATABASE addressbook;" + mysql -h 127.0.0.1 -u root -proot addressbook < addressbook.sql + + - name: Run tests + run: | + cp .github-offline/db.config.php config/cfg.db.php + php -S localhost:8000 -t . & + sleep 5 + export SERVER_NAME="localhost:8000" + export REQUEST_URI="/index.php" + php test/index.php diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 05db2ec..0000000 --- a/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: php -php: -- 5.5 -- 5.4 -- 7.0 -services: mysql -script: phpunit test/index.php