Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/actions/setup-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 'Setup'
description: 'Sets up the environment for Respect\Validation workflows.'

inputs:
php-version:
description: 'The PHP version to install.'
required: false
default: '8.5'
coverage:
description: 'PHP Coverage mode.'
required: false
default: 'none'
extensions:
description: 'Comma-separated list of PHP extensions to install.'
required: false
default: ''
python-version:
description: 'The Python version to install.'
required: false
python-deps:
description: 'Space-separated list of Python packages to install.'
required: false
default: ''

runs:
using: 'composite'
steps:

- uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php-version }}
coverage: ${{ inputs.coverage }}
extensions: ${{ inputs.extensions }}

- if: ${{ inputs.python-version != '' }}
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version }}

- if: ${{ inputs.python-deps != '' }}
run: pip install ${{ inputs.python-deps }}
shell: bash

- run: composer install --prefer-dist
shell: bash
59 changes: 59 additions & 0 deletions .github/workflows/ci-code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CI - Code

on:
push:
paths-ignore:
- 'bin/**'
- 'docs/**'
pull_request:
paths-ignore:
- 'bin/**'
- 'docs/**'

jobs:
tests:
name: Tests
runs-on: ubuntu-latest

strategy:
matrix:
php-version: ["8.5"]

steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-action
with:
php-version: ${{ matrix.php-version }}

- run: composer phpunit
- run: composer pest

code-coverage:
name: Code Coverage
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-action
with:
coverage: pcov

- name: Generating Code Coverage Report
run: ./vendor/bin/pest --compact --coverage-clover=coverage.xml

- name: Send Code Coverage Report to Codecov.io
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}

static-analysis:
name: Static Analysis
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-action

- run: composer phpcs
- run: composer phpstan
- run: bin/console lint:mixin
22 changes: 22 additions & 0 deletions .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: CI - Docs

on:
push:
paths-ignore:
- 'data/**'
- 'tests/**'
pull_request:
paths-ignore:
- 'data/**'
- 'tests/**'

jobs:
docs:
name: Lint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-action

- run: bin/console lint:docs
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
name: Continuous Integration (perf)
name: CI - Perf

on:
push:
paths-ignore:
- 'bin/**'
- 'docs/**'
paths:
- 'src/**'
- 'tests/**'
- '.github/**'
pull_request:
paths-ignore:
- 'bin/**'
- 'docs/**'
paths:
- 'src/**'
- 'tests/**'
- '.github/**'
workflow_dispatch:
inputs:
baseline:
Expand All @@ -23,31 +25,20 @@ jobs:
tests:
name: Benchmarks
runs-on: ubuntu-latest

continue-on-error: true # This job is experimental
permissions:
contents: write
pull-requests: write

strategy:
matrix:
php-version:
- "8.5"

steps:
- name: Checkout
uses: actions/checkout@v6
- uses: actions/checkout@v6
with:
persist-credentials: true

- name: Install PHP
uses: shivammathur/setup-php@v2
- uses: ./.github/actions/setup-action
with:
php-version: ${{ matrix.php-version }}
extensions: xdebug

- name: Install Dependencies
run: composer install --prefer-dist ${{ matrix.composer-extra-arguments }}

- name: Fetch Benchmarks
run: |
git fetch origin benchmarks
Expand Down Expand Up @@ -75,7 +66,7 @@ jobs:

cat report.md

- name: Commit Benchmark Results
- name: Commit Results
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: |
set -euo pipefail
Expand Down
94 changes: 0 additions & 94 deletions .github/workflows/continuous-integration-code.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/continuous-integration-docs.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- uses: actions/checkout@v6
- name: Release
uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag'
27 changes: 5 additions & 22 deletions .github/workflows/reuse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,11 @@ jobs:
name: Compliance Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-action
with:
python-version: '3.x'
python-deps: reuse

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.5
coverage: none

- name: Install dependencies
run: composer install --prefer-dist

- name: Install REUSE tool
run: pip install reuse

- name: Run REUSE check
run: reuse lint

- name: Run SPDX conventions check
run: bin/console lint:spdx
- run: reuse lint
- run: bin/console lint:spdx
2 changes: 1 addition & 1 deletion REUSE.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version = 1

[[annotations]]
path = [ "*.yml", "*.yaml", ".git*", "*.dist", "docs/.pages", "docs/validators/.pages", "composer.json", "tests/fixtures/*", ".github/*.yml", ".github/workflows/**.yml", ".github/PULL_REQUEST_TEMPLATE.md", ".github/ISSUE_TEMPLATE/**" ]
path = [ "*.yml", "*.yaml", ".git*", "*.dist", "docs/.pages", "docs/validators/.pages", "composer.json", "tests/fixtures/*", ".github/*.yml", ".github/actions/**.yml", ".github/workflows/**.yml", ".github/PULL_REQUEST_TEMPLATE.md", ".github/ISSUE_TEMPLATE/**" ]
SPDX-FileCopyrightText = "Respect Project Contributors"
SPDX-License-Identifier = "MIT"