|  | 
|  | 1 | +name: "Continuous Integration" | 
|  | 2 | + | 
|  | 3 | +on: | 
|  | 4 | +  - pull_request | 
|  | 5 | +  - push | 
|  | 6 | + | 
|  | 7 | +jobs: | 
|  | 8 | +  composer-json-lint: | 
|  | 9 | +    name: "Lint composer.json" | 
|  | 10 | + | 
|  | 11 | +    runs-on: "ubuntu-latest" | 
|  | 12 | + | 
|  | 13 | +    strategy: | 
|  | 14 | +      matrix: | 
|  | 15 | +        php-version: | 
|  | 16 | +          - "8.1" | 
|  | 17 | + | 
|  | 18 | +    steps: | 
|  | 19 | +      - name: "Checkout" | 
|  | 20 | +        uses: "actions/checkout@v2" | 
|  | 21 | + | 
|  | 22 | +      - name: "Install PHP" | 
|  | 23 | +        uses: "shivammathur/setup-php@v2" | 
|  | 24 | +        with: | 
|  | 25 | +          coverage: "none" | 
|  | 26 | +          php-version: "${{ matrix.php-version }}" | 
|  | 27 | +          tools: composer-normalize | 
|  | 28 | + | 
|  | 29 | +      - name: "Get composer cache directory" | 
|  | 30 | +        id: composercache | 
|  | 31 | +        run: echo "::set-output name=dir::$(composer config cache-files-dir)" | 
|  | 32 | + | 
|  | 33 | +      - name: "Cache dependencies" | 
|  | 34 | +        uses: actions/cache@v2 | 
|  | 35 | +        with: | 
|  | 36 | +          path: ${{ steps.composercache.outputs.dir }} | 
|  | 37 | +          key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }} | 
|  | 38 | +          restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer- | 
|  | 39 | + | 
|  | 40 | +      - name: "Install dependencies" | 
|  | 41 | +        run: "composer update --no-interaction --no-progress" | 
|  | 42 | + | 
|  | 43 | +      - name: "Validate composer.json" | 
|  | 44 | +        run: "composer validate --strict" | 
|  | 45 | + | 
|  | 46 | +      - name: "Normalize composer.json" | 
|  | 47 | +        run: "composer-normalize --dry-run" | 
|  | 48 | + | 
|  | 49 | +  tests: | 
|  | 50 | +    name: "Tests" | 
|  | 51 | + | 
|  | 52 | +    runs-on: "ubuntu-latest" | 
|  | 53 | + | 
|  | 54 | +    strategy: | 
|  | 55 | +      matrix: | 
|  | 56 | +        php-version: | 
|  | 57 | +          - "7.1" | 
|  | 58 | +          - "7.2" | 
|  | 59 | +          - "7.3" | 
|  | 60 | +          - "7.4" | 
|  | 61 | +          - "8.0" | 
|  | 62 | +          - "8.1" | 
|  | 63 | +        dependencies: | 
|  | 64 | +          - "lowest" | 
|  | 65 | +          - "highest" | 
|  | 66 | + | 
|  | 67 | +    steps: | 
|  | 68 | +      - name: "Checkout" | 
|  | 69 | +        uses: "actions/checkout@v2" | 
|  | 70 | + | 
|  | 71 | +      - name: "Install PHP" | 
|  | 72 | +        uses: "shivammathur/setup-php@v2" | 
|  | 73 | +        with: | 
|  | 74 | +          coverage: "pcov" | 
|  | 75 | +          php-version: "${{ matrix.php-version }}" | 
|  | 76 | +          ini-values: zend.assertions=1 | 
|  | 77 | + | 
|  | 78 | +      - name: "Get composer cache directory" | 
|  | 79 | +        id: composercache | 
|  | 80 | +        run: echo "::set-output name=dir::$(composer config cache-files-dir)" | 
|  | 81 | + | 
|  | 82 | +      - name: "Cache dependencies" | 
|  | 83 | +        uses: actions/cache@v2 | 
|  | 84 | +        with: | 
|  | 85 | +          path: ${{ steps.composercache.outputs.dir }} | 
|  | 86 | +          key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }} | 
|  | 87 | +          restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer- | 
|  | 88 | + | 
|  | 89 | +      - name: "Install lowest dependencies" | 
|  | 90 | +        if: ${{ matrix.dependencies == 'lowest' }} | 
|  | 91 | +        run: "composer update --no-interaction --no-progress --prefer-lowest" | 
|  | 92 | + | 
|  | 93 | +      - name: "Install highest dependencies" | 
|  | 94 | +        if: ${{ matrix.dependencies == 'highest' }} | 
|  | 95 | +        run: "composer update --no-interaction --no-progress" | 
|  | 96 | + | 
|  | 97 | +      - name: "Run tests" | 
|  | 98 | +        timeout-minutes: 3 | 
|  | 99 | +        run: "vendor/bin/phpunit --coverage-clover build/logs/clover.xml" | 
|  | 100 | + | 
|  | 101 | +      - name: "Coveralls" | 
|  | 102 | +        if: ${{ matrix.php-version == '8.1' && matrix.dependencies == 'highest' }} | 
|  | 103 | +        run: | | 
|  | 104 | +          wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.5.2/php-coveralls.phar | 
|  | 105 | +          php coveralls.phar -v | 
0 commit comments