Skip to content

Updated crud library (#16) #216

Updated crud library (#16)

Updated crud library (#16) #216

Workflow file for this run

name: "build"
on:
pull_request:
paths-ignore:
- ".docs/**"
push:
branches:
- "main"
tags:
- v*
schedule:
- cron: "0 8 * * 1" # At 08:00 on Monday
env:
extensions: "json"
cache-version: "1"
composer-version: "v2"
composer-options: "--no-interaction --no-progress --no-suggest --prefer-dist --prefer-stable"
coverage: "none"
jobs:
qa:
name: "Code quality assurance"
runs-on: "${{ matrix.operating-system }}"
strategy:
fail-fast: false
matrix:
php-version: ["8.1","8.2","8.3"]
operating-system: ["ubuntu-latest"]
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Setup PHP cache environment"
id: "extcache"
uses: "shivammathur/cache-extensions@v1"
with:
php-version: "${{ matrix.php-version }}"
extensions: "${{ env.extensions }}"
key: "${{ env.cache-version }}"
- name: "Cache PHP extensions"
uses: "actions/cache@v4"
with:
path: "${{ steps.extcache.outputs.dir }}"
key: "${{ steps.extcache.outputs.key }}"
restore-keys: "${{ steps.extcache.outputs.key }}"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: "${{ env.extensions }}"
tools: "composer:${{ env.composer-version }}, cs2pr"
coverage: "none"
- name: "Setup problem matchers for PHP"
run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"'
- name: "Setup composer & install dependencies"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "highest"
composer-options: "${{ env.composer-options }}"
custom-cache-key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}"
- name: "Coding Standard"
run: "make cs"
static-analysis:
name: "Code static analysis"
runs-on: "${{ matrix.operating-system }}"
strategy:
fail-fast: false
matrix:
php-version: ["8.1","8.2","8.3"]
operating-system: ["ubuntu-latest"]
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Setup PHP cache environment"
id: "extcache"
uses: "shivammathur/cache-extensions@v1"
with:
php-version: "${{ matrix.php-version }}"
extensions: "${{ env.extensions }}"
key: "${{ env.cache-version }}"
- name: "Cache PHP extensions"
uses: "actions/cache@v4"
with:
path: "${{ steps.extcache.outputs.dir }}"
key: "${{ steps.extcache.outputs.key }}"
restore-keys: "${{ steps.extcache.outputs.key }}"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: "${{ env.extensions }}"
tools: "composer:${{ env.composer-version }}"
coverage: "${{ env.coverage }}"
- name: "Setup problem matchers for PHP"
run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"'
- name: "Setup composer & install dependencies"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "highest"
composer-options: "${{ env.composer-options }}"
custom-cache-key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}"
- name: "PHPStan"
run: "make phpstan"
tests:
name: "Code tests"
runs-on: "${{ matrix.operating-system }}"
needs: ["qa", "static-analysis"]
strategy:
fail-fast: false
matrix:
php-version: ["8.1","8.2","8.3"]
operating-system: ["ubuntu-latest"]
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name : "Setup MySQL"
uses : "mirromutth/[email protected]"
with :
mysql version : "5.7"
mysql database : "testdb"
mysql root password : "root"
- name: "Setup PHP cache environment"
id: "extcache"
uses: "shivammathur/cache-extensions@v1"
with:
php-version: "${{ matrix.php-version }}"
extensions: "${{ env.extensions }}"
key: "${{ env.cache-version }}"
- name: "Cache PHP extensions"
uses: "actions/cache@v4"
with:
path: "${{ steps.extcache.outputs.dir }}"
key: "${{ steps.extcache.outputs.key }}"
restore-keys: "${{ steps.extcache.outputs.key }}"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: "${{ env.extensions }}"
tools: "composer:${{ env.composer-version }}"
coverage: "${{ env.coverage }}"
- name: "Setup problem matchers for PHP"
run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"'
- name: "Setup composer & install dependencies"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "highest"
composer-options: "${{ env.composer-options }}"
custom-cache-key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}"
- name: "Tests"
run: "make tests"
- name: "Upload logs"
uses: "actions/upload-artifact@v4"
with:
name: "Logs - Tests (${{ matrix.operating-system }}, ${{ matrix.php-version }})"
path: "var/log"
if-no-files-found: "ignore"
tests-code-coverage:
name: "Code tests with code coverage"
runs-on: "${{ matrix.operating-system }}"
needs: ["tests"]
strategy:
matrix:
php-version: ["8.1","8.2","8.3"]
operating-system: ["ubuntu-latest"]
fail-fast: false
if: "github.event_name == 'push'"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name : "Setup MySQL"
uses : "mirromutth/[email protected]"
with :
mysql version : "5.7"
mysql database : "testdb"
mysql root password : "root"
- name: "Setup PHP cache environment"
id: "extcache"
uses: "shivammathur/cache-extensions@v1"
with:
php-version: "${{ matrix.php-version }}"
extensions: "${{ env.extensions }}"
key: "${{ env.cache-version }}"
- name: "Cache PHP extensions"
uses: "actions/cache@v4"
with:
path: "${{ steps.extcache.outputs.dir }}"
key: "${{ steps.extcache.outputs.key }}"
restore-keys: "${{ steps.extcache.outputs.key }}"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: "${{ env.extensions }}"
tools: "composer:${{ env.composer-version }}"
coverage: "pcov"
- name: "Setup problem matchers for PHP"
run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"'
- name: "Setup composer & install dependencies"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "highest"
composer-options: "${{ env.composer-options }}"
custom-cache-key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}"
- name: "Tests"
run: "make coverage-clover"
- name: "Coveralls.io"
env:
CI_NAME: github
CI: true
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.5.3/php-coveralls.phar
php php-coveralls.phar --verbose --config tools/.coveralls.yml