Skip to content

FIX: Upd flash session #90

FIX: Upd flash session

FIX: Upd flash session #90

on:
push:
branches: [ master ]
workflow_dispatch:
name: build-and-test-from-zip
jobs:
tests:
name: PHP-${{ matrix.php }}-${{ matrix.os }}
env:
extensions: json, pdo
tag: hleb2-php${{ matrix.php }}-${{ matrix.os }}
archive_url: "https://github.com/phphleb/hleb/archive/refs/heads/master.zip"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
php:
- "8.2"
- "8.3"
- "8.4"
- "8.5"
steps:
- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
ini-values: date.timezone='UTC'
coverage: none
tools: composer:v2
- name: Check PHP
run: php -v
- name: Download framework archive (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: Invoke-WebRequest -Uri '${{ env.archive_url }}' -OutFile 'hleb2.zip'
- name: Download framework archive (Linux)
if: runner.os != 'Windows'
shell: bash
run: wget ${{ env.archive_url }} -O hleb2.zip
- name: Unpack framework archive (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Expand-Archive -Path hleb2.zip -DestinationPath .
Rename-Item -Path hleb-master -NewName '${{ env.tag }}_work'
- name: Unpack framework archive (Linux)
if: runner.os != 'Windows'
shell: bash
run: |
unzip -q hleb2.zip
mv hleb-master ${{ env.tag }}_work
- name: Copy work directory (Linux)
if: runner.os != 'Windows'
run: cp -r ./${{ env.tag }}_work ./${{ env.tag }}
- name: Copy work directory (Windows)
if: runner.os == 'Windows'
run: Copy-Item -Path ".\${{ env.tag }}_work" -Destination ".\${{ env.tag }}" -Recurse
shell: pwsh
- name: Install dependencies
run: cd ./${{ env.tag }} && composer require phphleb/tests
- name: Move installed libraries to work directory (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$libs = @('phphleb/test-o', 'phphleb/idnaconv', 'phphleb/psr-adapter', 'psr/container', 'psr/log', 'psr/simple-cache', 'phphleb/tests')
foreach ($lib in $libs) {
$source = "${{ env.tag }}/vendor/$lib"
$dest = "${{ env.tag }}_work/vendor/$lib"
$destDir = Split-Path -Parent $dest
New-Item -ItemType Directory -Path $destDir -Force | Out-Null
if (Test-Path $source) {
Copy-Item -Path $source -Destination $dest -Recurse -Force
}
}
Copy-Item -Path '${{ env.tag }}/vendor/autoload.php' -Destination '${{ env.tag }}_work/vendor/autoload.php' -Force
Copy-Item -Path '${{ env.tag }}/vendor/composer' -Destination '${{ env.tag }}_work/vendor/composer' -Recurse -Force
- name: Move installed libraries to work directory (Linux)
if: runner.os != 'Windows'
shell: bash
run: |
libs=("phphleb/test-o" "phphleb/idnaconv" "phphleb/psr-adapter" "psr/container" "psr/log" "psr/simple-cache" "phphleb/tests")
for lib in "${libs[@]}"; do
source="${{ env.tag }}/vendor/$lib"
dest="${{ env.tag }}_work/vendor/$lib"
if [ -d "$source" ]; then
mkdir -p "$(dirname "$dest")"
cp -r "$source" "$dest"
fi
done
cp '${{ env.tag }}/vendor/autoload.php' '${{ env.tag }}_work/vendor/autoload.php'
cp -r '${{ env.tag }}/vendor/composer' '${{ env.tag }}_work/vendor/composer'
- name: Set strict mode
run: php ./${{ env.tag }}_work/console reverse-strict-mode-feature --set
- name: Code reduction check
run: php ./${{ env.tag }}_work/console clearing-comment-feature
- name: Framework version
run: php ./${{ env.tag }}_work/console --version
- name: Check autoloader
run: php ./${{ env.tag }}_work/console autoloader-support-feature
- name: Run tests
working-directory: ./${{ env.tag }}_work
run: php ./vendor/phphleb/test-o/run ./vendor/phphleb/tests/