Task #424: add github actions to lint the code and release to TER #2
Workflow file for this run
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
--- | |
# This GitHub Actions workflow uses the same development tools that are also installed locally | |
# via Composer or PHIVE and calls them using the Composer scripts. | |
name: CI with Composer scripts | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
schedule: | |
- cron: '15 3 * * 1' | |
permissions: | |
contents: read | |
jobs: | |
php-lint: | |
name: "PHP linter" | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Install PHP" | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "${{ matrix.php-version }}" | |
coverage: none | |
tools: composer:v2 | |
- name: "Show the Composer configuration" | |
run: "composer config --global --list" | |
- name: "Run PHP lint" | |
run: "composer ci:php:lint" | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: | |
- "7.4" | |
- "8.0" | |
- "8.1" | |
- "8.2" | |
- "8.3" | |
code-quality: | |
name: "Code quality checks" | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Install PHP" | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "${{ matrix.php-version }}" | |
coverage: none | |
tools: composer:v2 | |
- name: "Show Composer version" | |
run: "composer --version" | |
- name: "Show the Composer configuration" | |
run: "composer config --global --list" | |
- name: "Cache dependencies installed with composer" | |
uses: actions/cache@v3 | |
with: | |
key: "php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}" | |
path: ~/.cache/composer | |
restore-keys: "php${{ matrix.php-version }}-composer-\n" | |
- name: "Install Composer dependencies" | |
run: "composer install --no-progress" | |
- name: "Run command" | |
run: "composer ci:${{ matrix.command }}" | |
strategy: | |
fail-fast: false | |
matrix: | |
command: | |
- "composer:normalize" | |
- "composer:psr-verify" | |
- "php:sniff" | |
- "php:stan" | |
- "xliff:lint" | |
php-version: | |
- "8.1" |