Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Tests

on:
push:
branches: [ master, main, testing-strategy ]
pull_request:
branches: [ master, main ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3']

name: PHP ${{ matrix.php }} Tests

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, json
coverage: xdebug
tools: composer:v2

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Validate composer.json
run: composer validate --strict

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest

- name: Run unit tests
run: composer test:unit

- name: Run integration tests
run: composer test:integration

- name: Generate coverage report (PHP 8.3 only)
if: matrix.php == '8.3'
run: composer test:coverage

- name: Upload coverage to Codecov (PHP 8.3 only)
if: matrix.php == '8.3'
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
fail_ci_if_error: false
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
vendor
composer.lock
.phpunit.cache
coverage
coverage.xml
.phpunit.result.cache
tests/Integration/SandboxCredentials.php
.idea/
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion Procfile

This file was deleted.

61 changes: 59 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# FamilySearch PHP Lite SDK

[![Packagist](https://img.shields.io/packagist/v/familysearch/fs-php-lite.svg)](https://packagist.org/packages/familysearch/fs-php-lite)
[![Build Status](https://travis-ci.org/FamilySearch/fs-php-lite.svg?branch=master)](https://travis-ci.org/FamilySearch/fs-php-lite)
![Tests](https://github.com/PermanentOrg/fs-php-lite/workflows/Tests/badge.svg?branch=master)
[![PHP Version](https://img.shields.io/badge/php-8.1%20%7C%208.2%20%7C%208.3-blue.svg)](https://github.com/PermanentOrg/fs-php-lite)

Lite PHP SDK for the [FamilySearch API](https://familysearch.org/developers/).

Expand Down Expand Up @@ -144,4 +145,60 @@ or a [FamilySearchPlatform](http://familysearch.github.io/gedcomx-php/class-Gedc
object.

gedcomx-php must be installed and included separately. gedcomx-php version 3.1.2
or later is required.
or later is required.

## Testing

The SDK includes comprehensive unit and integration tests.

### Running Tests

```bash
# Install dependencies
composer install

# Run all tests
composer test

# Run only unit tests
composer test:unit

# Run only integration tests
composer test:integration

# Generate code coverage report
composer test:coverage
```

### Test Structure

- **Unit Tests** - Fast tests that don't make HTTP requests
- **Integration Tests** - Tests using recorded API responses via php-vcr
- **Examples** - Working demo applications in `/examples` directory

See [TESTING.md](TESTING.md) for detailed testing documentation.

## Requirements

- PHP 8.1 or higher
- ext-curl
- ext-json

## Development

### Contributing

1. Fork the repository
2. Create a feature branch
3. Write tests for your changes
4. Ensure all tests pass: `composer test`
5. Submit a pull request

### CI/CD

Tests run automatically via GitHub Actions on:
- PHP 8.1, 8.2, and 8.3
- Every push and pull request
- Code coverage reports generated for PHP 8.3

See [.github/workflows/tests.yml](.github/workflows/tests.yml) for CI configuration.
Loading