Skip to content

Commit

Permalink
Update pipeline configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Dec 21, 2024
1 parent 1ec1468 commit b5d10b8
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 40 deletions.
100 changes: 61 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,40 @@
on:
- "pull_request"
- "push"
pull_request: null
push: null

name: "CI"
name: CI

env:
PHP_VERSION: "8.3"
PHP_VERSION: 8.4
PHP_INI_VALUES: memory_limit=-1, assert.exception=1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=1, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=32M

jobs:
coding-guidelines:
name: "Coding Guidelines"
name: Coding Guidelines

runs-on: "ubuntu-latest"
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: Checkout
uses: actions/checkout@v4

- name: "Check coding guidelines with PHP-CS-Fixer"
run: "./tools/php-cs-fixer fix --dry-run --show-progress=dots --using-cache=no --verbose"
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
extensions: none, iconv, json, phar, tokenizer
coverage: none
tools: none

- name: Run PHP-CS-Fixer
run: ./tools/php-cs-fixer fix --dry-run --show-progress=dots --using-cache=no --verbose

static-analysis:
name: Static Analysis

runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Checkout
Expand All @@ -33,74 +43,86 @@ jobs:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
php-version: ${{ env.PHP_VERSION }}
coverage: none
tools: none

- name: Run PHPStan
run: ./tools/phpstan analyse --no-progress --error-format=github

unit-tests:
name: "Unit Tests"
name: Unit Tests

runs-on: "ubuntu-latest"
needs: static-analysis

runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: Checkout
uses: actions/checkout@v4

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
ini-values: ${{ env.PHP_INI_VALUES }}
coverage: none

- name: "Run unit tests with PHPUnit"
run: "./tools/phpunit --testsuite unit --testdox"
- name: Run unit tests with PHPUnit
run: ./tools/phpunit --testsuite unit

integration-tests:
name: "Integration Tests"
name: Integration Tests

needs: unit-tests

runs-on: "ubuntu-latest"
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: Checkout
uses: actions/checkout@v4

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
ini-values: ${{ env.PHP_INI_VALUES }}
coverage: none

- name: "Run integration tests with PHPUnit"
run: "./tools/phpunit --testsuite integration"
- name: Run unit tests with PHPUnit
run: ./tools/phpunit --testsuite integration

code-coverage:
name: "Code Coverage"
name: Code Coverage

needs: unit-tests
needs: integration-tests

runs-on: "ubuntu-latest"
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: Checkout
uses: actions/checkout@v4

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
ini-values: ${{ env.PHP_INI_VALUES }}
coverage: xdebug

- name: "Collect code coverage with PHPUnit"
run: "./tools/phpunit --testsuite unit --coverage-clover coverage.xml"
- name: Collect code coverage with PHPUnit
run: ./tools/phpunit --log-junit junit.xml --coverage-clover=coverage.xml

- name: Upload test results to Codecov.io
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Send code coverage to Codecov.io
uses: codecov/codecov-action@v2
- name: Upload code coverage data to Codecov.io
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.3-8892BF.svg?style=flat-square)](https://php.net/)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.4-8892BF.svg?style=flat-square)](https://php.net/)
[![CI Status](https://github.com/sebastianbergmann/raytracer/workflows/CI/badge.svg?branch=main&event=push)](https://github.com/sebastianbergmann/raytracer/actions)
[![Code Coverage](https://codecov.io/gh/sebastianbergmann/raytracer/branch/main/graph/badge.svg?token=IfbgdrCpOM)](https://codecov.io/gh/sebastianbergmann/raytracer)

Expand Down

0 comments on commit b5d10b8

Please sign in to comment.