Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 1 | name: run-tests |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | pull_request: |
| 6 | schedule: |
| 7 | - cron: "0 0 * * *" |
| 8 | |
| 9 | jobs: |
| 10 | run-tests: |
| 11 | runs-on: ${{ matrix.os }} |
| 12 | strategy: |
| 13 | fail-fast: false |
| 14 | matrix: |
| 15 | os: [ubuntu-latest, windows-latest] |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame^] | 16 | php: [8.1, 8.0, 7.4, 7.3] |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 17 | |
| 18 | name: ${{ matrix.os }} - P${{ matrix.php }} |
| 19 | |
| 20 | steps: |
| 21 | - name: Checkout code |
| 22 | uses: actions/checkout@v2 |
| 23 | |
| 24 | - name: Cache dependencies |
| 25 | uses: actions/cache@v2 |
| 26 | with: |
| 27 | path: ~/.composer/cache/files |
| 28 | key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} |
| 29 | |
| 30 | - name: Setup PHP |
| 31 | uses: shivammathur/setup-php@v2 |
| 32 | with: |
| 33 | php-version: ${{ matrix.php }} |
| 34 | extensions: ldap, json |
| 35 | coverage: none |
| 36 | |
| 37 | - name: Install dependencies |
| 38 | run: composer update --prefer-dist --no-interaction |
| 39 | |
| 40 | - name: Execute tests |
| 41 | run: vendor/bin/phpunit |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame^] | 42 | |
| 43 | run-analysis: |
| 44 | runs-on: ${{ matrix.os }} |
| 45 | name: Static code analysis (PHP ${{ matrix.php }}) |
| 46 | |
| 47 | strategy: |
| 48 | fail-fast: false |
| 49 | matrix: |
| 50 | os: [ubuntu-latest] |
| 51 | php: [8.0] |
| 52 | |
| 53 | steps: |
| 54 | - name: Checkout code |
| 55 | uses: actions/checkout@v2 |
| 56 | |
| 57 | - name: Cache dependencies |
| 58 | uses: actions/cache@v2 |
| 59 | with: |
| 60 | path: ~/.composer/cache/files |
| 61 | key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} |
| 62 | |
| 63 | - name: Setup PHP |
| 64 | uses: shivammathur/setup-php@v2 |
| 65 | with: |
| 66 | php-version: ${{ matrix.php }} |
| 67 | extensions: ldap, json |
| 68 | coverage: none |
| 69 | tools: psalm |
| 70 | |
| 71 | - name: Validate composer.json |
| 72 | run: composer validate |
| 73 | |
| 74 | - name: Install dependencies |
| 75 | run: composer update --prefer-dist --no-interaction |
| 76 | |
| 77 | - name: Run Psalm |
| 78 | run: psalm |