Skip to content

Add PHPUnit workflow, fix path handling bug, REUSE/php-cs compliance #2

Add PHPUnit workflow, fix path handling bug, REUSE/php-cs compliance

Add PHPUnit workflow, fix path handling bug, REUSE/php-cs compliance #2

Workflow file for this run

# 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