Skip to content

Expose ShouldContinueAsNew and HistorySize #347

Expose ShouldContinueAsNew and HistorySize

Expose ShouldContinueAsNew and HistorySize #347

Workflow file for this run

name: Unit
on:
workflow_call:
inputs:
test-suite:
required: true
type: string
fail-fast:
required: false
type: boolean
default: true
test-timeout:
required: false
type: number
default: 15
run-temporal-test-server:
required: false
type: boolean
default: true
push:
branches:
- 'master'
- '2.*'
paths-ignore:
- 'README.md'
- '.gitignore'
- '.gitattributes'
- 'psalm.xml'
- 'psalm-baseline.xml'
- '.editorconfig'
pull_request:
paths-ignore:
- 'README.md'
- '.gitignore'
- '.gitattributes'
- 'psalm.xml'
- 'psalm-baseline.xml'
- '.editorconfig'
jobs:
test:
name: PHP${{ matrix.php }}${{ matrix.extensions-suffix }}, ${{ matrix.os }}, ${{ matrix.dependencies }} deps
runs-on: ${{ matrix.os }}
timeout-minutes: ${{ matrix.timeout-minutes }}
env: {GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'}
strategy:
fail-fast: ${{ inputs.fail-fast }}
matrix:
php: [ 8.1, 8.2, 8.3 ]
os: [ ubuntu-latest, windows-latest ]
extensions-suffix: [ '', ', protobuf' ]
dependencies: [ lowest , highest ]
timeout-minutes: [ '${{ inputs.test-timeout }}' ]
exclude:
- os: windows-latest
php: 8.2
- os: windows-latest
extensions-suffix: ', protobuf'
- os: windows-latest
php: 8.3
steps:
- name: Set Git To Use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
extensions: dom, sockets, grpc, curl ${{ matrix.extensions-suffix }}
# extensions: dom, sockets, grpc, curl
- name: Check Out Code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer Dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: php-${{ matrix.php }}-${{ matrix.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
php-${{ matrix.php }}-${{ matrix.os }}-composer-
- name: Install lowest dependencies from composer.json
if: matrix.dependencies == 'lowest'
run: composer update --no-interaction --no-progress --prefer-lowest
- name: Validate lowest dependencies
if: matrix.dependencies == 'lowest'
env:
COMPOSER_POOL_OPTIMIZER: 0
run: vendor/bin/validate-prefer-lowest
- name: Install highest dependencies from composer.json
if: matrix.dependencies == 'highest'
run: composer update --no-interaction --no-progress
- name: Download RoadRunner
if: inputs.run-temporal-test-server == true
run: |
vendor/bin/rr get --no-interaction --stability=beta
- name: Run tests with Temporal test server
if: inputs.run-temporal-test-server == true
run: ${{ format(
'vendor/bin/phpunit --testsuite={0} --testdox --colors=always --exclude-group {1}',
inputs.test-suite,
contains(matrix.extensions-suffix, 'protobuf') && 'skip-on-test-server,skip-ext-protobuf' || 'skip-on-test-server'
) }}
env:
RUN_TEMPORAL_TEST_SERVER: ${{ inputs.run-temporal-test-server }}
- name: Run tests without Temporal test server
if: inputs.run-temporal-test-server == false
run: vendor/bin/phpunit --testsuite=${{ inputs.test-suite }} --testdox --colors=always