Skip to content

Composer Dev(deps-dev): Bump kporras07/composer-symlinks from 1.3 to 1.4 #374

Composer Dev(deps-dev): Bump kporras07/composer-symlinks from 1.3 to 1.4

Composer Dev(deps-dev): Bump kporras07/composer-symlinks from 1.3 to 1.4 #374

name: Unit tests + Code coverage report
# Runs PHPUnit unit and Codeception wp-browser wpunit tests, merges the code coverage, commits the html report to
# GitHub Pages, generates a README badge with the coverage percentage.
on:
push:
branches:
- main
pull_request:
types: [ opened, reopened, ready_for_review, synchronize ]
branches:
- main
workflow_dispatch:
concurrency:
# Cancel previous runs of this workflow if they are testing the same branch
group: ${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.head_ref) || github.sha }}
cancel-in-progress: true
jobs:
get-repo-name:
runs-on: ubuntu-latest
outputs:
repository-name: ${{ steps.repo-name.outputs.name }}
steps:
- name: Extract repository name
id: repo-name
# Extract just the repository name (e.g., "wp-module-data") from the full repository path
# (e.g., "newfold-labs/wp-module-data") by splitting on '/' and taking the second field.
run: echo "name=$(echo ${{ github.repository }} | cut -d'/' -f2)" >> $GITHUB_OUTPUT
unit-tests:
needs: get-repo-name
permissions:
contents: write
pull-requests: write
uses: newfold-labs/workflows/.github/workflows/reusable-codecoverage.yml@main
with:
php-versions: '["7.4", "8.0", "8.1", "8.2", "8.3"]'
coverage-php-version: '7.4'
repository-name: ${{ needs.get-repo-name.outputs.repository-name }}
minimum-coverage: 25
secrets:
repo_token: ${{ secrets.GITHUB_TOKEN }}