diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e8fac7c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,60 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + test: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + php-version: ['7.4', '8.0', '8.1', '8.2', '8.3'] + + name: PHP ${{ matrix.php-version }} Tests + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: mbstring, xml, ctype, json + coverage: xdebug + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v4 + with: + path: vendor + key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php-${{ matrix.php-version }}- + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Run test suite + run: vendor/bin/phpunit + + - name: Generate coverage report + if: matrix.php-version == '8.3' + run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml + + - name: Upload coverage to Coveralls + if: matrix.php-version == '8.3' + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + run: | + composer global require php-coveralls/php-coveralls + export PATH="$HOME/.composer/vendor/bin:$PATH" + php-coveralls --coverage_clover=build/logs/clover.xml --json_path=build/logs/coveralls-upload.json -v diff --git a/README.md b/README.md index a223c18..297df3d 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,8 @@ # GedcomX - PHP SDK [![Packagist](https://img.shields.io/packagist/v/gedcomx/gedcomx-php.svg)](https://packagist.org/packages/gedcomx/gedcomx-php) -[![Build Status](https://travis-ci.org/FamilySearch/gedcomx-php.svg?branch=master)](https://travis-ci.org/FamilySearch/gedcomx-php) +[![CI](https://github.com/FamilySearch/gedcomx-php/actions/workflows/ci.yml/badge.svg)](https://github.com/FamilySearch/gedcomx-php/actions/workflows/ci.yml) [![Coverage Status](https://coveralls.io/repos/FamilySearch/gedcomx-php/badge.svg?branch=master&service=github)](https://coveralls.io/github/FamilySearch/gedcomx-php?branch=master) -[![Dependency Status](https://www.versioneye.com/user/projects/5633c23236d0ab0016001f02/badge.svg?style=flat)](https://www.versioneye.com/user/projects/5633c23236d0ab0016001f02) The PHP implementation of [GEDCOM X](http://www.gedcomx.org), including GEDCOM X extension projects. The library only provides classes for serialization and deserialization of GEDCOM X @@ -69,6 +68,13 @@ Do **one** of the following steps to activate Composer and install the gedcomx-p ## Changelog +* v3.1.0 + * Migrate from Travis CI to GitHub Actions + * Add multi-version PHP testing (7.4, 8.0, 8.1, 8.2, 8.3) + * Update CI/CD pipeline with automated testing and coverage reporting + * Update README badges to reflect GitHub Actions status + * Added CHANGELOG.md for a more extensive overview on changes + * v3.0.0 * Split out the API networking code into [gedcomx-php-client](https://github.com/FamilySearch/gedcomx-php-client)