Skip to content

Code Analysis and Tests #1623

Code Analysis and Tests

Code Analysis and Tests #1623

Workflow file for this run

# --------------------------------------------------------------------------------------------------------- #
# Code analysis and tests workflow
#
# @see https://github.com/shivammathur/setup-php
# @see https://github.com/laravel/framework/blob/9.x/.github/workflows/tests.yml
# --------------------------------------------------------------------------------------------------------- #
name: 'Code Analysis and Tests'
on:
push:
pull_request:
# Schedule tests to run every day at 06:00 (if possible)
# Doing so should enable us to capture evt. changes in
# dependencies that are breaking...
schedule:
- cron: '0 6 * * *'
jobs:
athenaeum_tests:
name: "Athenaeum (PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }})"
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: true
matrix:
# See OS and PHP version options on https://github.com/shivammathur/setup-php
operating-system: [ 'ubuntu-22.04' ]
php-versions: [ '8.2', '8.3' ]
steps:
# ------------------------------------------------------------------------------------------------------- #
# Checkout code ...
# ------------------------------------------------------------------------------------------------------- #
- name: "Checkout"
uses: actions/checkout@v4
# ------------------------------------------------------------------------------------------------------- #
# Setup & configure PHP
# ------------------------------------------------------------------------------------------------------- #
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
# PHP Extensions are based on those that Laravel also uses.args:
# @see https://github.com/laravel/framework/blob/11.x/.github/workflows/tests.yml
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, redis-phpredis/phpredis@5.3.7, igbinary, msgpack, lzf, zstd, lz4, memcached, gmp
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: none
# ------------------------------------------------------------------------------------------------------- #
# Install dependencies
# ------------------------------------------------------------------------------------------------------- #
# Not sure that caching packages is a too good idea...
# - name: "Get composer cache directory"
# id: composer-cache
# run: echo "::set-output name=dir::$(composer config cache-files-dir)"
#
# - name: "Cache composer dependencies"
# uses: actions/cache@v2
# with:
# path: ${{ steps.composer-cache.outputs.dir }}
#
# # Use composer.json for key, if composer.lock is not committed.
# # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
# restore-keys: ${{ runner.os }}-composer-
- name: "Install dependencies"
run: composer install --no-progress --prefer-dist --no-interaction --optimize-autoloader --ansi
# ------------------------------------------------------------------------------------------------------- #
# Run code analysis
# ------------------------------------------------------------------------------------------------------- #
- name: "Analysis"
run: composer run analyse
- name: "Compatibility check"
run: composer run check
- name: "Style check"
run: composer run cs
# ------------------------------------------------------------------------------------------------------- #
# Run tests
# ------------------------------------------------------------------------------------------------------- #
- name: "Prepare test environment"
run: |
composer run test-env --ansi
vendor/bin/codecept build
- name: "Run tests"
run: vendor/bin/codecept run