Add PHPUnit workflow, fix path handling bug, REUSE/php-cs compliance #2
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
| # SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | |
| # SPDX-License-Identifier: MIT | |
| name: PHPUnit | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| - stable* | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: phpunit-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| phpunit: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| php-versions: ["8.2", "8.3", "8.4"] | |
| name: PHPUnit PHP ${{ matrix.php-versions }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Set up php ${{ matrix.php-versions }} | |
| uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4 # v2.35.4 | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| extensions: ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib | |
| coverage: none | |
| ini-file: development | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install dependencies | |
| run: | | |
| composer i | |
| composer bin phpunit install | |
| - name: PHPUnit | |
| run: composer run test:unit | |
| summary: | |
| permissions: | |
| contents: none | |
| runs-on: ubuntu-latest-low | |
| needs: phpunit | |
| if: always() | |
| name: phpunit-summary | |
| steps: | |
| - name: Summary status | |
| run: if ${{ needs.phpunit.result != 'success' && needs.phpunit.result != 'skipped' }}; then exit 1; fi |