|
| 1 | +on: |
| 2 | + push: |
| 3 | + |
| 4 | +jobs: |
| 5 | + tests: |
| 6 | + runs-on: ${{ matrix.operating-system }} |
| 7 | + strategy: |
| 8 | + matrix: |
| 9 | + operating-system: [ 'ubuntu-latest', 'windows-latest', 'macos-latest' ] |
| 10 | + php-versions: [ '7.3', '7.4', '8.1', '8.2', '8.3' ] |
| 11 | + phpunit-versions: [ 'latest' ] |
| 12 | + include: |
| 13 | + - operating-system: 'ubuntu-latest' |
| 14 | + php-versions: '8.0' |
| 15 | + phpunit-versions: 9 |
| 16 | + steps: |
| 17 | + - name: Setup PHP |
| 18 | + uses: shivammathur/setup-php@v2 |
| 19 | + with: |
| 20 | + php-version: ${{ matrix.php-versions }} |
| 21 | + extensions: mbstring, intl, json |
| 22 | + ini-values: post_max_size=256M, max_execution_time=180 |
| 23 | + coverage: xdebug |
| 24 | + tools: php-cs-fixer, phpunit:${{ matrix.phpunit-versions }} |
| 25 | + env: |
| 26 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 27 | + - name: Checkout code |
| 28 | + uses: actions/checkout@v2 |
| 29 | + - name: Get composer cache directory |
| 30 | + id: composer-cache |
| 31 | + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
| 32 | + |
| 33 | + - name: Cache dependencies |
| 34 | + uses: actions/cache@v4 |
| 35 | + with: |
| 36 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 37 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
| 38 | + restore-keys: ${{ runner.os }}-composer- |
| 39 | + |
| 40 | + - name: Install dependencies |
| 41 | + run: composer install --prefer-dist |
| 42 | + |
| 43 | + - name: Run tests |
| 44 | + run: composer test |
| 45 | + env: |
| 46 | + FLARUM_USERNAME: ${{ secrets.FLARUM_USERNAME }} |
| 47 | + FLARUM_PASSWORD: ${{ secrets.FLARUM_PASSWORD }} |
0 commit comments