|
| 1 | +name: Continuous Integration |
| 2 | + |
| 3 | +on: |
| 4 | + - push |
| 5 | + - pull_request |
| 6 | + |
| 7 | +jobs: |
| 8 | + tests: |
| 9 | + strategy: |
| 10 | + matrix: |
| 11 | + include: |
| 12 | + - operating-system: 'windows-latest' |
| 13 | + php-version: '8.0' |
| 14 | + job-description: 'on Windows' |
| 15 | + |
| 16 | + - operating-system: 'windows-latest' |
| 17 | + php-version: '8.1' |
| 18 | + job-description: 'on Windows' |
| 19 | + |
| 20 | + name: PHP ${{ matrix.php-version }} ${{ matrix.job-description }} |
| 21 | + |
| 22 | + runs-on: ${{ matrix.operating-system }} |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Set git to use LF |
| 26 | + run: | |
| 27 | + git config --global core.autocrlf false |
| 28 | + git config --global core.eol lf |
| 29 | +
|
| 30 | + - name: Checkout code |
| 31 | + uses: actions/checkout@v2 |
| 32 | + |
| 33 | + - name: Setup PHP |
| 34 | + uses: shivammathur/setup-php@v2 |
| 35 | + with: |
| 36 | + php-version: ${{ matrix.php-version }} |
| 37 | + extensions: fiber-amphp/ext-fiber@master |
| 38 | + |
| 39 | + - name: Get Composer cache directory |
| 40 | + id: composer-cache |
| 41 | + run: echo "::set-output name=dir::$(composer config cache-dir)" |
| 42 | + |
| 43 | + - name: Cache dependencies |
| 44 | + uses: actions/cache@v2 |
| 45 | + with: |
| 46 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 47 | + key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}-${{ matrix.composer-flags }} |
| 48 | + restore-keys: | |
| 49 | + composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}- |
| 50 | + composer-${{ runner.os }}-${{ matrix.php-version }}- |
| 51 | + composer-${{ runner.os }}- |
| 52 | + composer- |
| 53 | +
|
| 54 | + - name: Install dependencies |
| 55 | + uses: nick-invision/retry@v2 |
| 56 | + with: |
| 57 | + timeout_minutes: 5 |
| 58 | + max_attempts: 5 |
| 59 | + retry_wait_seconds: 30 |
| 60 | + command: | |
| 61 | + composer update --optimize-autoloader --no-interaction --no-progress ${{ matrix.composer-flags }} |
| 62 | + composer info -D |
| 63 | +
|
| 64 | + - name: Run static analysis |
| 65 | + run: vendor/bin/psalm.phar |
| 66 | + |
| 67 | + - name: Run style fixer |
| 68 | + env: |
| 69 | + PHP_CS_FIXER_IGNORE_ENV: 1 |
| 70 | + run: vendor/bin/php-cs-fixer --diff --dry-run -v fix |
0 commit comments