|
17 | 17 |
|
18 | 18 | - name: Check that changelog has been updated. |
19 | 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.1' ] |
| 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 | +
|
| 53 | + php-coding-standards: |
| 54 | + name: PHP coding standards |
| 55 | + runs-on: ubuntu-latest |
| 56 | + strategy: |
| 57 | + matrix: |
| 58 | + php-versions: [ '8.1' ] |
| 59 | + steps: |
| 60 | + - uses: actions/checkout@master |
| 61 | + - name: Setup PHP, with composer and extensions |
| 62 | + uses: shivammathur/setup-php@v2 |
| 63 | + with: |
| 64 | + php-version: ${{ matrix.php-versions }} |
| 65 | + extensions: json |
| 66 | + coverage: none |
| 67 | + tools: composer:v2 |
| 68 | + # https://github.com/shivammathur/setup-php#cache-composer-dependencies |
| 69 | + - name: Get composer cache directory |
| 70 | + id: composer-cache |
| 71 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 72 | + - name: Cache dependencies |
| 73 | + uses: actions/cache@v2 |
| 74 | + with: |
| 75 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 76 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
| 77 | + restore-keys: ${{ runner.os }}-composer- |
| 78 | + - name: Install Dependencies |
| 79 | + run: | |
| 80 | + composer install --no-interaction --no-progress |
| 81 | + - name: PHPCS |
| 82 | + run: | |
| 83 | + composer coding-standards-check/phpcs |
| 84 | +
|
| 85 | + markdownlint: |
| 86 | + runs-on: ubuntu-latest |
| 87 | + name: markdownlint |
| 88 | + steps: |
| 89 | + - name: Checkout |
| 90 | + uses: actions/checkout@v2 |
| 91 | + - name: Get yarn cache directory path |
| 92 | + id: yarn-cache-dir-path |
| 93 | + run: echo "::set-output name=dir::$(yarn cache dir)" |
| 94 | + - name: Cache yarn packages |
| 95 | + uses: actions/cache@v2 |
| 96 | + id: yarn-cache |
| 97 | + with: |
| 98 | + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} |
| 99 | + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} |
| 100 | + restore-keys: | |
| 101 | + ${{ runner.os }}-yarn- |
| 102 | + - name: Yarn install |
| 103 | + uses: actions/setup-node@v2 |
| 104 | + with: |
| 105 | + node-version: '20' |
| 106 | + - run: yarn install |
| 107 | + - name: markdownlint |
| 108 | + run: yarn coding-standards-check/markdownlint |
0 commit comments