Skip to content

Small refactoring

Small refactoring #53

Workflow file for this run

name: Tests
on: [ push, pull_request ]
permissions: read-all
env:
INSTANCE: docs/cashbox
ARTIFACT: webHelpCASHBOX2-all.zip
BUILDER_VERSION: 232.10275
jobs:
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [ "8.1", "8.2", "8.3" ]
stability: [ "prefer-lowest", "prefer-stable" ]
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
services:
mysql:
image: mysql:8
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: forge
ports:
- 33306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, pdo_mysql, gd, igbinary, msgpack, lzf, zstd, lz4, gmp
ini-values: error_reporting=E_ALL
coverage: none
- name: Install dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress --optimize-autoloader
- name: Execute tests
run: vendor/bin/pest --colors=always
env:
DB_CONNECTION: mysql
DB_USERNAME: root
DB_PORT: ${{ job.services.mysql.ports[3306] }}
windows:
runs-on: windows-latest
strategy:
fail-fast: true
matrix:
php: [ "8.1", "8.2", "8.3" ]
stability: [ "prefer-lowest", "prefer-stable" ]
name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - Windows
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, pdo_mysql, gd, igbinary, msgpack, lzf, zstd, lz4, gmp
ini-values: error_reporting=E_ALL
coverage: none
- name: Install dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress --optimize-autoloader
- name: Execute tests
run: composer test
env:
DB_CONNECTION: mysql
DB_USERNAME: root
DB_PORT: ${{ job.services.mysql.ports[3306] }}
documentation_build:
name: Build Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, simplexml
coverage: xdebug
- name: Configure git
run: git config --global --add safe.directory /github/workspace
- name: Build documentation
uses: JetBrains/writerside-github-action@v4
with:
instance: ${{ env.INSTANCE }}
artifact: ${{ env.ARTIFACT }}
docker-version: ${{ env.BUILDER_VERSION }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: docs
path: |
artifacts/${{ env.ARTIFACT }}
artifacts/report.json
retention-days: 7
documentation_test:
needs: build

Check failure on line 136 in .github/workflows/tests.yml

View workflow run for this annotation

GitHub Actions / Tests

Invalid workflow file

The workflow is not valid. .github/workflows/tests.yml (Line: 136, Col: 16): Job 'documentation_test' depends on unknown job 'build'.
name: Test Documentation
runs-on: ubuntu-latest
steps:
- name: Download docs artifact
uses: actions/download-artifact@v3
with:
name: docs
path: artifacts
- name: Test documentation
uses: JetBrains/writerside-checker-action@v1
with:
instance: ${{ env.INSTANCE }}