diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 637f8d4b..a15c14e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,106 +1,46 @@ -name: CI +name: Tests -on: - push: - branches: [ master ] - pull_request: +on: ['push', 'pull_request'] jobs: - # analysis: - # strategy: - # matrix: - # dependencies: - # - "locked" - # php-version: - # - "7.4" - # operating-system: - # - "ubuntu-latest" - - # runs-on: ${{ matrix.operating-system }} - # steps: - # - name: PHP Installation - # uses: shivammathur/setup-php@v2 - # with: - # php-version: "${{ matrix.php-version }}" - # extensions: bcmath - - # - name: Code Checkout - # uses: actions/checkout@v2 - - # - name: "Cache dependencies" - # uses: "actions/cache@v2" - # with: - # path: | - # ~/.composer/cache - # vendor - # key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - # restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - - # - name: "Install lowest dependencies" - # if: ${{ matrix.dependencies == 'lowest' }} - # run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest --ignore-platform-req=php" - - # - name: "Install highest dependencies" - # if: ${{ matrix.dependencies == 'highest' }} - # run: "composer update --no-interaction --no-progress --no-suggest --ignore-platform-req=php" - - # - name: "Install locked dependencies" - # if: ${{ matrix.dependencies == 'locked' }} - # run: "composer install --no-interaction --no-progress --no-suggest --ignore-platform-req=php" - - # - name: Validate - # run: | - # composer validate - # composer normalize --dry-run - - tests: + ci: + runs-on: ${{ matrix.os }} strategy: matrix: - dependencies: - # - "lowest" - # - "highest" - - "locked" - php-version: - - "7.3" - - "7.4" - - "8.0" - - "8.1" - - "8.2" - operating-system: - - "ubuntu-latest" - - runs-on: ${{ matrix.operating-system }} + os: [ubuntu-latest, macos-latest, windows-latest] + php: ['7.3', '7.4', '8.0', '8.1', '8.2'] + dependency-version: [prefer-lowest, prefer-stable] + parallel: ['', '--parallel'] + exclude: + - php: 8.1 + os: macos-latest + - php: 8.1 + os: windows-latest + - php: 8.2 + os: macos-latest + - php: 8.2 + os: windows-latest + + name: PHP ${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} - ${{ matrix.parallel }} steps: - - name: PHP Installation - uses: shivammathur/setup-php@v2 - with: - php-version: "${{ matrix.php-version }}" - extensions: bcmath - - - name: Code Checkout - uses: actions/checkout@v2 - - - name: "Cache dependencies" - uses: "actions/cache@v2" - with: - path: | - ~/.composer/cache - vendor - key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - - - name: "Install lowest dependencies" - if: ${{ matrix.dependencies == 'lowest' }} - run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest" - - - name: "Install highest dependencies" - if: ${{ matrix.dependencies == 'highest' }} - run: "composer update --no-interaction --no-progress --no-suggest" - - - name: "Install locked dependencies" - if: ${{ matrix.dependencies == 'locked' }} - run: "composer install --no-interaction --no-progress --no-suggest" - - - name: Test - run: vendor/bin/pest + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + tools: composer:v2 + coverage: none + + # - name: Setup Problem Matchers + # run: | + # echo "::add-matcher::${{ runner.tool_cache }}/php.json" + # echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Install PHP dependencies + run: composer update --${{ matrix.dependency-version }} --no-interaction --no-progress + + - name: Unit Tests + run: php bin/pest --colors=always --exclude-group=integration ${{ matrix.parallel }}