CI / Static #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI / Static | |
on: | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
validation: | |
name: "Static validation" | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: [ | |
'7.3', | |
'7.4', | |
'8.0', | |
'8.1', | |
'8.2', | |
] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: Loeffelhardt/el-setup-php-action@main | |
with: | |
php-version: ${{ matrix.php-version }} | |
extensions: dom, libxml | |
tools: composer:v2 | |
- name: Composer get cache directory | |
id: composer-cache | |
run: | | |
echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Composer cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Composer validate | |
run: composer validate | |
- name: Composer version | |
run: composer --version | |
- name: Composer install | |
run: composer install --no-scripts | |
- name: Run CodeStyle checks | |
run: vendor/bin/ecs check src/ | |
- name: Run PHPStan | |
run: vendor/bin/phpstan analyze -clear-result-cache -c phpstan.neon src/ -l 8 | |
- name: Run PHPUnit Tests | |
run: vendor/bin/phpunit --testdox tests/ | |
- name: Run Security check | |
run: vendor/bin/security-checker security:check composer.lock | |
- name: Notify ms teams channel | |
if: failure() | |
uses: Loeffelhardt/el-ms-teams-notification-action@main | |
with: | |
github-token: ${{ secrets.ACCESS_TOKEN }} | |
ms-teams-webhook-uri: ${{ secrets.MS_TEAMS_WEBHOOK_URI }} | |
notification-summary: "CI el-opentrans failed (validation)" | |
notification-color: dc3545 | |
release-title: CI el-opentrans | |
notification-text: Please click on "View Workflow Run" to analyse it. | |
timezone: Europe/Berlin |