Skip to content

Commit

Permalink
Update run-tests.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Dec 21, 2024
1 parent c93ce1f commit f294aad
Showing 1 changed file with 16 additions and 21 deletions.
37 changes: 16 additions & 21 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,49 +28,44 @@ jobs:
shell: bash
run: |
if [ "${{ github.ref }}" == "refs/heads/master" ]; then
git clone -b master https://github.com/hydephp/hyde.git
git clone -b master https://github.com/hydephp/develop.git runner
else
git clone -b develop https://github.com/hydephp/hyde.git
git clone -b develop https://github.com/hydephp/develop.git runner
fi
- name: Copy over framework code
shell: bash
run: |
mkdir -p ./hyde/packages/hyde/framework/src
mkdir -p ./hyde/packages/hyde/framework/tests
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/hyde
cp -r ../temp/src/. ./hyde/packages/hyde/framework/src
cp -r ../temp/tests/. ./hyde/packages/hyde/framework/tests
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=hyde ./src/. ./hyde/packages/hyde/framework/src
rsync -a --exclude=hyde ./tests/. ./hyde/packages/hyde/framework/tests
rsync -a --exclude=runner ./src/. ./runner/packages/framework/src
rsync -a --exclude=runner ./tests/. ./runner/packages/framework/tests
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: Move test runner configuration
shell: bash
run: cp tests/phpunit.xml.dist hyde/phpunit.xml.dist
- name: Install dependencies
run: cd runner && composer install

- name: Set environment to testing
run: cd hyde && echo "ENV=testing" > .env
run: cd runner && echo "ENV=testing" > .env
- name: Execute tests (Unit and Feature tests) via PHPUnit/Pest
run: cd hyde && vendor/bin/pest --log-junit report.xml
run: cd runner && vendor/bin/pest --log-junit report.xml
env:
ENV: testing

- name: Ping statistics server with test results
run: |
cd hyde
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 }}

0 comments on commit f294aad

Please sign in to comment.