|
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + |
| 9 | +jobs: |
| 10 | + tests: |
| 11 | + if: "!contains(github.event.head_commit.message, 'skip ci')" |
| 12 | + name: PHP ${{ matrix.php-versions }} on ${{ matrix.os }} |
| 13 | + runs-on: ${{ matrix.os }} |
| 14 | + continue-on-error: ${{ matrix.php-versions == '8.1' }} |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + php-versions: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] |
| 19 | + os: [ubuntu-latest, windows-latest] |
| 20 | + |
| 21 | + steps: |
| 22 | + - name: Configure git |
| 23 | + if: runner.os == 'Windows' |
| 24 | + run: git config --system core.autocrlf false; git config --system core.eol lf |
| 25 | + |
| 26 | + - name: Checkout |
| 27 | + uses: actions/checkout@v2 |
| 28 | + |
| 29 | + - name: Set up PHP ${{ matrix.php-versions }} |
| 30 | + uses: shivammathur/setup-php@v2 |
| 31 | + with: |
| 32 | + php-version: ${{ matrix.php-versions }} |
| 33 | + ini-values: date.timezone=Europe/Berlin |
| 34 | + |
| 35 | + - name: Setup Problem Matchers for PHP |
| 36 | + run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" |
| 37 | + |
| 38 | + - name: Validate composer.json and composer.lock |
| 39 | + run: composer validate |
| 40 | + |
| 41 | + - name: Get Composer Cache Directory |
| 42 | + id: composer-cache |
| 43 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 44 | + |
| 45 | + - name: Cache dependencies |
| 46 | + |
| 47 | + with: |
| 48 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 49 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
| 50 | + restore-keys: ${{ runner.os }}-composer- |
| 51 | + |
| 52 | + - name: Install dependencies |
| 53 | + run: > |
| 54 | + curl -sSL https://dl.bintray.com/xp-runners/generic/xp-run-8.3.0.sh > xp-run && |
| 55 | + composer install --prefer-dist && |
| 56 | + echo "vendor/autoload.php" > composer.pth |
| 57 | +
|
| 58 | + - name: Run test suite |
| 59 | + run: sh xp-run xp.unittest.TestRunner src/test/php |
0 commit comments