Internal: Test code refactors and cleanup #1309
Workflow file for this run
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: 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: git clone -b master https://github.com/hydephp/develop.git --depth 1 runner | |
- name: Copy over framework code | |
shell: bash | |
run: | | |
rm -rf ./runner/packages/framework/src | |
rm -rf ./runner/packages/framework/tests | |
mkdir -p ./runner/packages/framework/src | |
mkdir -p ./runner/packages/framework/tests | |
if [ "${{ matrix.os }}" == "windows-latest" ]; then | |
# For Windows, copy to temp then back to preserve structure | |
mkdir ../temp | |
cp -r ./ ../temp | |
rm -rf ../temp/runner | |
cp -r ../temp/src/. ./runner/packages/framework/src | |
cp -r ../temp/tests/. ./runner/packages/framework/tests | |
else | |
# For Unix systems, use rsync | |
rsync -a --exclude=runner ./src/. ./runner/packages/framework/src | |
rsync -a --exclude=runner ./tests/. ./runner/packages/framework/tests | |
fi | |
- name: Install dependencies | |
run: cd runner && composer install | |
- name: Set environment to testing | |
run: cd runner && echo "ENV=testing" > .env | |
- name: Execute tests (Unit and Feature tests) via PHPUnit/Pest | |
run: cd runner && vendor/bin/pest --log-junit report.xml | |
env: | |
ENV: testing | |
- name: Ping statistics server with test results | |
run: | | |
cd runner | |
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 }} |