Update contribution guide link in CONTRIBUTING.md #2632
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 1.x | |
| - 2.x | |
| - 3.x | |
| - 4.x | |
| pull_request: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: tests-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| php: [ 8.4 ] | |
| node-version: [ "22.x" ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Fetch base branch | |
| if: github.event_name == 'pull_request' | |
| env: | |
| BASE_REF: ${{ github.base_ref }} | |
| run: git fetch --no-tags origin "$BASE_REF:refs/remotes/origin/$BASE_REF" | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| coverage: pcov | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php- | |
| - name: Install dependencies | |
| if: steps.composer-cache.outputs.cache-hit != 'true' | |
| run: composer install --prefer-dist --no-progress --no-suggest | |
| - name: Create sqlite database | |
| run: touch storage/database-test.sqlite | |
| - name: Set up the .env file | |
| run: touch .env | |
| - name: Generate Application Key | |
| run: php artisan key:generate | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22.x" | |
| - name: Install NPM Dependencies | |
| run: npm install --force | |
| - name: Build assets | |
| run: npm run build | |
| - name: Run test suite | |
| if: github.event_name != 'pull_request' | |
| run: php artisan test --parallel | |
| - name: Assert coverage driver is active | |
| if: github.event_name == 'pull_request' | |
| run: php -m | grep -qi pcov | |
| - name: Run test suite with coverage | |
| if: github.event_name == 'pull_request' | |
| run: php artisan test --parallel --coverage-cobertura=build/logs/cobertura.xml | |
| - name: Setup Python | |
| if: github.event_name == 'pull_request' | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install diff-cover | |
| if: github.event_name == 'pull_request' | |
| run: pip install "diff-cover==9.*" | |
| - name: Enforce 75% patch coverage | |
| if: github.event_name == 'pull_request' | |
| env: | |
| BASE_REF: ${{ github.base_ref }} | |
| run: | | |
| diff-cover build/logs/cobertura.xml \ | |
| --compare-branch="origin/$BASE_REF" \ | |
| --fail-under=75 \ | |
| --markdown-report=build/diff-cover.md | |
| - name: Publish coverage report to job summary | |
| if: always() && github.event_name == 'pull_request' | |
| run: | | |
| if [ -f build/diff-cover.md ]; then | |
| cat build/diff-cover.md >> "$GITHUB_STEP_SUMMARY" | |
| fi |