Skip to content

Internal: Clean up test code #1150

Internal: Clean up test code

Internal: Clean up test code #1150

Workflow file for this run

name: Framework Tests (Matrix)
on:
push:
branches: ["master", "develop"]
pull_request:
branches: ["master", "develop"]
merge_group:
jobs:
run-tests:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
php: [8.1, 8.2, 8.3]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: fileinfo, zip
- name: Install Hyde
shell: bash
run: |
if [ "${{ github.ref }}" == "refs/heads/master" ]; then
git clone -b master https://github.com/hydephp/hyde.git
else
git clone -b develop https://github.com/hydephp/hyde.git
fi
- name: Copy over framework source code
shell: bash
run: |
mkdir -p ./hyde/packages/hyde/framework/src
# Since we can't use rsync on Windows, we need to copy the files to a temporary directory and then copy them back
if [ "${{ matrix.os }}" == "windows-latest" ]; then
mkdir ../temp
cp -r ./ ../temp
rm -rf ../temp/hyde
cp -r ../temp/. ./hyde/packages/hyde/framework/src
else
rsync -a --exclude=hyde ./. ./hyde/packages/hyde/framework/src
fi
- name: Update composer.json to load framework from local source
run: |
cd hyde
composer config repositories.framework path ./packages/hyde/framework
composer require hyde/testing:dev-master hyde/framework:dev-develop
- name: Download test runner configuration
run: cd hyde && curl https://raw.githubusercontent.com/hydephp/develop/master/packages/hyde/phpunit.xml.dist -o phpunit.xml.dist
- name: Set environment to testing
run: cd hyde && echo "ENV=testing" > .env
- name: Execute tests (Unit and Feature tests) via PHPUnit/Pest
run: cd hyde && vendor/bin/pest --log-junit report.xml
env:
ENV: testing
- name: Ping statistics server with test results
run: |
cd hyde
curl https://raw.githubusercontent.com/hydephp/develop/6e9d17f31879f4ccda13a3fec4029c9663bccec0/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php
php ping.php "Framework CI Matrix" ${{ secrets.OPENANALYTICS_TOKEN }}