build #1175
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: "build" | |
on: | |
pull_request: | |
paths-ignore: | |
- ".docs/**" | |
push: | |
branches: | |
- "*" | |
schedule: | |
- cron: "0 8 * * 1" # At 08:00 on Monday | |
env: | |
extensions: "json" | |
cacheVersion: "1" | |
composerVersion: "v2" | |
composerInstall: "composer install" | |
jobs: | |
qa: | |
name: "Quality Assurance" | |
runs-on: "${{ matrix.operating-system }}" | |
strategy: | |
matrix: | |
node-versions: [ "18.1.0" ] | |
php-versions: [ "8.1" ] | |
operating-system: [ "ubuntu-latest" ] | |
fail-fast: false | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v3" | |
- name: "Setup PHP cache environment" | |
id: "extcache" | |
uses: "shivammathur/cache-extensions@v1" | |
with: | |
php-version: "${{ matrix.php-versions }}" | |
extensions: "${{ env.extensions }}" | |
key: "${{ env.cacheVersion }}" | |
- name: "Cache PHP extensions" | |
uses: "actions/cache@v3" | |
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-versions }}" | |
extensions: "${{ env.extensions }}" | |
tools: "composer:${{ env.composerVersion }} " | |
- name: "Setup problem matchers for PHP" | |
run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"' | |
- name: "Get Composer cache directory" | |
id: "composercache" | |
run: 'echo "::set-output name=dir::$(composer config cache-files-dir)"' | |
- name: "Cache PHP dependencies" | |
uses: "actions/cache@v3" | |
with: | |
path: "${{ steps.composercache.outputs.dir }}" | |
key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}" | |
restore-keys: "${{ runner.os }}-composer-" | |
- name: "Validate Composer" | |
run: "composer validate" | |
- name: "Install dependencies" | |
run: "${{ env.composerInstall }}" | |
- name: "Coding Standard" | |
run: "make codesniffer" | |
- name: "Install Node.js" | |
uses: "actions/setup-node@v3" | |
with: | |
node-version: "${{ matrix.node-versions }}" | |
- name: "Cache Node.js dependencies" | |
uses: "actions/cache@v3" | |
with: | |
path: node_modules | |
key: "${{ runner.os }}-npm-${{ hashFiles('**/package.json') }}" | |
restore-keys: "${{ runner.os }}-npm-" | |
- name: "Install Node.js dependencies" | |
run: npm install | |
- name: "Prettier" | |
run: make prettier | |
static-analysis: | |
name: "Static analysis" | |
runs-on: "${{ matrix.operating-system }}" | |
strategy: | |
matrix: | |
php-versions: [ "8.1" ] | |
operating-system: [ "ubuntu-latest" ] | |
fail-fast: false | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v3" | |
- name: "Setup PHP cache environment" | |
id: "extcache" | |
uses: "shivammathur/cache-extensions@v1" | |
with: | |
php-version: "${{ matrix.php-versions }}" | |
extensions: "${{ env.extensions }}" | |
key: "${{ env.cacheVersion }}" | |
- name: "Cache PHP extensions" | |
uses: "actions/cache@v3" | |
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-versions }}" | |
extensions: "${{ env.extensions }}" | |
tools: "composer:${{ env.composerVersion }} " | |
- name: "Setup problem matchers for PHP" | |
run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"' | |
- name: "Get Composer cache directory" | |
id: "composercache" | |
run: 'echo "::set-output name=dir::$(composer config cache-files-dir)"' | |
- name: "Cache PHP dependencies" | |
uses: "actions/cache@v3" | |
with: | |
path: "${{ steps.composercache.outputs.dir }}" | |
key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}" | |
restore-keys: "${{ runner.os }}-composer-" | |
- name: "Install dependencies" | |
run: "${{ env.composerInstall }}" | |
- name: "PHPStan" | |
run: "make phpstan" | |
- name: "Install Node.js" | |
uses: "actions/setup-node@v3" | |
with: | |
node-version: "${{ matrix.node-versions }}" | |
- name: "Cache Node.js dependencies" | |
uses: "actions/cache@v3" | |
with: | |
path: node_modules | |
key: "${{ runner.os }}-npm-${{ hashFiles('**/package.json') }}" | |
restore-keys: "${{ runner.os }}-npm-" | |
- name: "Install Node.js dependencies" | |
run: npm ci --force | |
- name: "TSC" | |
run: make ts | |
tests: | |
name: "Tests" | |
runs-on: "${{ matrix.operating-system }}" | |
strategy: | |
matrix: | |
php-versions: [ "8.1" ] | |
operating-system: [ "ubuntu-latest" ] | |
fail-fast: false | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v3" | |
- name: "Setup PHP cache environment" | |
id: "extcache" | |
uses: "shivammathur/cache-extensions@v1" | |
with: | |
php-version: "${{ matrix.php-versions }}" | |
extensions: "${{ env.extensions }}" | |
key: "${{ env.cacheVersion }}" | |
- name: "Cache PHP extensions" | |
uses: "actions/cache@v3" | |
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-versions }}" | |
extensions: "${{ env.extensions }}" | |
tools: "composer:${{ env.composerVersion }} " | |
- name: "Setup problem matchers for PHP" | |
run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"' | |
- name: "Get Composer cache directory" | |
id: "composercache" | |
run: 'echo "::set-output name=dir::$(composer config cache-files-dir)"' | |
- name: "Cache PHP dependencies" | |
uses: "actions/cache@v3" | |
with: | |
path: "${{ steps.composercache.outputs.dir }}" | |
key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}" | |
restore-keys: "${{ runner.os }}-composer-" | |
- name: "Install dependencies" | |
run: "${{ env.composerInstall }}" | |
- name: "Setup problem matchers for PHPUnit" | |
run: 'echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"' | |
- name: "Tests" | |
run: "make test" |