1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- name: Run tests
- on:
- workflow_call:
- inputs:
- deps:
- type: string
- required: false
- default: stable
- continue_on_error:
- type: boolean
- required: false
- default: false
- jobs:
- test:
- name: PHP ${{ matrix.php }}
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
- steps:
- - name: Check out code
- uses: actions/checkout@v3.5.3
- - name: Install PHP
- uses: shivammathur/setup-php@2.25.4
- with:
- php-version: ${{ matrix.php }}
- tools: composer:v2
- coverage: none
- - name: Set up problem matchers
- run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- - name: Update to dev stability
- if: inputs.deps == 'dev'
- run: |
- composer config minimum-stability dev
- composer config prefer-stable false
- - name: Install dependencies
- if: inputs.deps != 'lowest'
- uses: nick-fields/retry@v2.8.3
- with:
- timeout_minutes: 5
- max_attempts: 5
- command: composer update --no-interaction --no-progress
- - name: Install dependencies (--prefer-lowest)
- if: inputs.deps == 'lowest'
- uses: nick-fields/retry@v2.8.3
- with:
- timeout_minutes: 5
- max_attempts: 5
- command: composer update --prefer-lowest --prefer-stable --no-interaction --no-progress
- - name: Install PHPUnit
- uses: nick-fields/retry@v2.8.3
- with:
- timeout_minutes: 5
- max_attempts: 5
- command: composer bin phpunit update --no-interaction --no-progress
- - name: Run tests
- if: inputs.continue_on_error == false
- run: make test
- - name: Run tests (but don't complain)
- if: inputs.continue_on_error == true
- run: make test
- continue-on-error: true
- - name: Upload coverage
- uses: codecov/codecov-action@v3.1.4
|