Skip to content

Add SEP-51 (XDR-JSON) encoding support #71

Add SEP-51 (XDR-JSON) encoding support

Add SEP-51 (XDR-JSON) encoding support #71

Workflow file for this run

name: Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
unit-tests:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3', '8.4']
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup PHP
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
with:
php-version: ${{ matrix.php }}
extensions: mbstring, xml, ctype, json, bcmath, gmp, pcntl, sodium
coverage: pcov
tools: composer:v2
- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run unit tests
if: matrix.php != '8.4'
run: vendor/bin/phpunit --testsuite unit
- name: Run unit tests with coverage
if: matrix.php == '8.4'
run: vendor/bin/phpunit --testsuite unit --coverage-clover coverage/clover.xml
- name: Upload coverage to Codecov
if: matrix.php == '8.4'
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/clover.xml
fail_ci_if_error: false
verbose: true