Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve CI #58

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
114 changes: 114 additions & 0 deletions .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: integrate

on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- ".github/workflows/integrate.yml"
- "**.php"
- "composer.json"
- "composer.lock"
- "phpcs.xml.dist"
- "phpstan.neon.dist"
- "phpunit.xml.dist"
push:
branches:
- main
paths:
- ".github/workflows/integrate.yml"
- "**.php"
- "composer.json"
- "composer.lock"
- "phpcs.xml.dist"
- "phpstan.neon.dist"
- "phpunit.xml.dist"

jobs:
unit_tests:
strategy:
fail-fast: true
matrix:
php-version: ["7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]
dependencies: [lowest, highest]
os: [windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2

- name: Install dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependencies }}

- name: Run unit tests
run: vendor/bin/phpunit
if: matrix.os != 'ubuntu-latest' || matrix.php-version != '8.3'

- name: Run unit tests with coverage
run: vendor/bin/phpunit --coverage-clover coverage.xml
if: matrix.os == 'ubuntu-latest' && matrix.php-version == '8.3'

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
if: env.CODECOV_TOKEN && matrix.os == 'ubuntu-latest' && matrix.php-version == '8.3'
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

coding_standards:
strategy:
matrix:
php-version: ["7.4"]
dependencies: [highest]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2

- name: Install dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependencies }}

- name: Run linter
run: composer run phpcs

static_analysis:
strategy:
matrix:
php-version: ["7.4"]
dependencies: [highest]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2

- name: Install dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependencies }}

- name: Run static analysis
run: composer run phpstan
Loading