Skip to content

Commit

Permalink
CI: Use shared github action templates
Browse files Browse the repository at this point in the history
  • Loading branch information
pprkut committed Jan 17, 2024
1 parent bc49823 commit a7095b7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 102 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/general.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SPDX-FileCopyrightText: Copyright 2023 Move Agency Group B.V., Zwolle, The Netherlands
# SPDX-License-Identifier: CC0-1.0

name: General Tests
on: [push, pull_request, workflow_dispatch]

jobs:
reuse:
uses: lunr-php/actions-templates/.github/workflows/reuse.yml@master
95 changes: 11 additions & 84 deletions .github/workflows/php-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,89 +3,16 @@
# SPDX-License-Identifier: CC0-1.0

name: PHP Tests
on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

jobs:
phpunit:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
name: "PHP-${{ matrix.php-versions }}: PHPUnit"
strategy:
matrix:
php-versions: ['8.1']
experimental: [false]
include:
- php-versions: 8.2
experimental: true
- php-versions: 8.3
experimental: true
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: phpunit:9.5.x
extensions: uopz

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: Install dependencies
run: composer update

- name: Run PHPunit
run: phpunit --configuration tests/phpunit.xml --coverage-clover=coverage.xml

- name: Collect code coverage
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml

phpcs:
runs-on: ubuntu-latest
continue-on-error: false
name: "PHPCS"
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Codestyle checkout
uses: actions/checkout@v3
with:
repository: 'lunr-php/lunr-coding-standard'

# Relative path under $GITHUB_WORKSPACE to place the repository
path: 'codestyle'

- name: Setup PHPCS
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: cs2pr, phpcs

- name: Run PHPCS
run: phpcs -q --report=checkstyle src --standard=$GITHUB_WORKSPACE/codestyle/Lunr | cs2pr

phpstan:
runs-on: ubuntu-latest
continue-on-error: false
name: "PHPStan"
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHPStan
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: phpstan
extensions: uopz

- name: Install dependencies
run: composer update

- name: Run PHPStan
run: phpstan analyze src -l2 --configuration tests/phpstan.neon.dist
php-tests:
uses: lunr-php/actions-templates/.github/workflows/php-composer.yml@master
with:
phpstan-level: 2
allow-style-failures: false
allow-phpstan-failures: false
phpcs-whitelist: tests/phan.config.php tests/phpstan.autoload.inc.php tests/test.bootstrap.inc.php
php-extensions: uopz
stable-php-versions: '["8.1"]'
experimental-php-versions: '["8.2","8.3"]'
18 changes: 0 additions & 18 deletions .github/workflows/reuse.yml

This file was deleted.

0 comments on commit a7095b7

Please sign in to comment.