|
| 1 | +on: pull_request |
| 2 | +name: Review |
| 3 | +jobs: |
| 4 | + changelog: |
| 5 | + runs-on: ubuntu-latest |
| 6 | + name: Changelog should be updated |
| 7 | + strategy: |
| 8 | + fail-fast: false |
| 9 | + steps: |
| 10 | + - name: Checkout |
| 11 | + uses: actions/checkout@v2 |
| 12 | + with: |
| 13 | + fetch-depth: 2 |
| 14 | + |
| 15 | + - name: Git fetch |
| 16 | + run: git fetch |
| 17 | + |
| 18 | + - name: Check that changelog has been updated. |
| 19 | + run: git diff --exit-code origin/${{ github.base_ref }} -- CHANGELOG.md && exit 1 || exit 0 |
| 20 | + |
| 21 | + test-composer-files: |
| 22 | + name: Validate composer |
| 23 | + runs-on: ubuntu-latest |
| 24 | + strategy: |
| 25 | + matrix: |
| 26 | + php-versions: [ '8.3' ] |
| 27 | + dependency-version: [ prefer-lowest, prefer-stable ] |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@master |
| 30 | + - name: Setup PHP, with composer and extensions |
| 31 | + uses: shivammathur/setup-php@v2 |
| 32 | + with: |
| 33 | + php-version: ${{ matrix.php-versions }} |
| 34 | + extensions: json |
| 35 | + coverage: none |
| 36 | + tools: composer:v2 |
| 37 | + # https://github.com/shivammathur/setup-php#cache-composer-dependencies |
| 38 | + - name: Get composer cache directory |
| 39 | + id: composer-cache |
| 40 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 41 | + - name: Cache dependencies |
| 42 | + uses: actions/cache@v2 |
| 43 | + with: |
| 44 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 45 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
| 46 | + restore-keys: ${{ runner.os }}-composer- |
| 47 | + - name: Validate composer files |
| 48 | + run: | |
| 49 | + composer validate --strict composer.json |
| 50 | + # Check that dependencies resolve. |
| 51 | + composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction |
| 52 | + - name: Check that composer file is normalized |
| 53 | + run: | |
| 54 | + composer normalize --dry-run |
| 55 | +
|
| 56 | + php-coding-standards: |
| 57 | + name: PHP coding standards |
| 58 | + runs-on: ubuntu-latest |
| 59 | + strategy: |
| 60 | + matrix: |
| 61 | + php-versions: [ '8.3' ] |
| 62 | + steps: |
| 63 | + - uses: actions/checkout@master |
| 64 | + - name: Setup PHP, with composer and extensions |
| 65 | + uses: shivammathur/setup-php@v2 |
| 66 | + with: |
| 67 | + php-version: ${{ matrix.php-versions }} |
| 68 | + extensions: json |
| 69 | + coverage: none |
| 70 | + tools: composer:v2 |
| 71 | + # https://github.com/shivammathur/setup-php#cache-composer-dependencies |
| 72 | + - name: Get composer cache directory |
| 73 | + id: composer-cache |
| 74 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 75 | + - name: Cache dependencies |
| 76 | + uses: actions/cache@v2 |
| 77 | + with: |
| 78 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 79 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
| 80 | + restore-keys: ${{ runner.os }}-composer- |
| 81 | + - name: Install Dependencies |
| 82 | + run: | |
| 83 | + composer install --no-interaction --no-progress |
| 84 | + - name: PHPCS |
| 85 | + run: | |
| 86 | + composer coding-standards-check/phpcs |
| 87 | +
|
| 88 | + php-code-analysis: |
| 89 | + name: PHP code analysis |
| 90 | + runs-on: ubuntu-latest |
| 91 | + strategy: |
| 92 | + matrix: |
| 93 | + php-versions: [ '8.3' ] |
| 94 | + steps: |
| 95 | + - uses: actions/checkout@master |
| 96 | + - name: Setup PHP, with composer and extensions |
| 97 | + uses: shivammathur/setup-php@v2 |
| 98 | + with: |
| 99 | + php-version: ${{ matrix.php-versions }} |
| 100 | + extensions: json |
| 101 | + coverage: none |
| 102 | + tools: composer:v2 |
| 103 | + # https://github.com/shivammathur/setup-php#cache-composer-dependencies |
| 104 | + - name: Get composer cache directory |
| 105 | + id: composer-cache |
| 106 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 107 | + - name: Cache dependencies |
| 108 | + uses: actions/cache@v2 |
| 109 | + with: |
| 110 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 111 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
| 112 | + restore-keys: ${{ runner.os }}-composer- |
| 113 | + - name: Code analysis |
| 114 | + run: | |
| 115 | + ./scripts/code-analysis |
| 116 | +
|
| 117 | + coding-standards-markdown: |
| 118 | + name: Markdown coding standards |
| 119 | + runs-on: ubuntu-latest |
| 120 | + steps: |
| 121 | + - name: Checkout |
| 122 | + uses: actions/checkout@v4 |
| 123 | + |
| 124 | + - name: Coding standards |
| 125 | + run: | |
| 126 | + docker run --rm --volume "$(pwd):/md" peterdavehello/markdownlint markdownlint --ignore LICENSE.md '**/*.md' |
0 commit comments