Skip to content

PHP 8.1+ updates

PHP 8.1+ updates #9

Workflow file for this run

name: Tests
on:
workflow_dispatch:
push:
branches:
- master
paths:
- '.github/workflows/tests.yaml'
- '**.php'
- 'composer.json'
- 'composer.lock'
- 'phpunit/**.xml'
- 'phpunit.xml'
pull_request:
branches:
- master
paths:
- '.github/workflows/tests.yaml'
- '**.php'
- 'composer.json'
- 'composer.lock'
- 'phpunit/**.xml'
- 'phpunit.xml'
jobs:
run:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php-version: ["7.4", "8.0", "8.1"]
fhir-version: ["DSTU1", "DSTU2", "STU3", "R4"]
include:
- php-version: "7.4"
phpunit-version: "9"
paratest-version: "6"
- php-version: "8.0"
phpunit-version: "9"
paratest-version: "6"
- php-version: "8.1"
phpunit-version: "9"
paratest-version: "6"
name: ${{ matrix.fhir-version }} - PHP ${{ matrix.php-version }} - PHPUnit ${{ matrix.phpunit-version }}
steps:
- uses: actions/[email protected]
- uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php-version }}
extensions: libxml simplexml json zip
# https://github.com/mheap/phpunit-github-actions-printer/blob/master/.github/workflows/ci.yml#L32
- name: Set PHPUnit Version
shell: pwsh
run: |
$content = Get-Content -Path 'composer.json' | ConvertFrom-Json
$content.{require-dev}.{phpunit/phpunit} = "^${{ matrix.phpunit-version }}"
$content | ConvertTo-Json | Set-Content -Path 'composer.json'
- name: Set Paratest Version
shell: pwsh
run: |
$content = Get-Content -Path 'composer.json' | ConvertFrom-Json
$content.{require-dev}.{brianium/paratest} = "^${{ matrix.paratest-version }}"
$content | ConvertTo-Json | Set-Content -Path 'composer.json'
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/[email protected]
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: "composer-${{ runner.os }}-${{ matrix.php-version }}-${{ matrix.phpunit-version }}-${{ hashFiles('**/composer.lock') }}"
- name: Cache downloaded FHIR sources
uses: actions/cache@v2
with:
path: ./input
key: "fhir-${{ runner.os }}-${{ matrix.php-version }}-${{ matrix.phpunit-version }}-${{ hashFiles('**/composer.lock') }}"
- name: Install Composer deps
run: |
composer install --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: Generate code
run: |
./bin/generate.sh --useExisting --versions '${{ matrix.fhir-version }}'
- uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 18
- name: Install FHIR validator
run: |
wget --quiet https://github.com/hapifhir/org.hl7.fhir.core/releases/download/5.6.75/validator_cli.jar -O ./bin/validator_cli.jar
- name: Run tests
run: |
./vendor/bin/paratest -c 'phpunit/${{ matrix.fhir-version }}.xml'