11name : Framework Tests (Matrix)
2+
23on :
34 push :
45 branches : ["master", "develop"]
56 pull_request :
67 branches : ["master", "develop"]
8+ merge_group :
79
810jobs :
911
@@ -22,31 +24,35 @@ jobs:
2224 php-version : ${{ matrix.php }}
2325 extensions : fileinfo, zip
2426
25- - name : Echo GitHub ref
26- run : echo ${{ github.ref }}
27-
28- - name : Install Hyde (master)
29- if : " github.ref == 'refs/heads/master'"
30- run : git clone -b master https://github.com/hydephp/hyde.git
31-
32- - name : Install Hyde (develop)
33- if : " github.ref != 'refs/heads/master'"
34- run : git clone -b develop https://github.com/hydephp/hyde.git
35-
36- - name : Require latest framework version
37- if : " github.ref == 'refs/heads/master'"
38- run : cd hyde && composer require hyde/framework:dev-master hyde/testing:dev-master
27+ - name : Install Hyde
28+ shell : bash
29+ run : |
30+ if [ "${{ github.ref }}" == "refs/heads/master" ]; then
31+ git clone -b master https://github.com/hydephp/hyde.git
32+ else
33+ git clone -b develop https://github.com/hydephp/hyde.git
34+ fi
3935
40- - name : Require latest development framework version
41- if : " github.ref == 'refs/heads/develop'"
42- run : cd hyde && composer require hyde/framework:dev-develop hyde/testing:dev-master
36+ - name : Copy over framework source code
37+ shell : bash
38+ run : |
39+ mkdir -p ./hyde/packages/hyde/framework/src
4340
44- - name : Require pull request framework version
45- if : " github.ref != 'refs/heads/master' && github.ref != 'refs/heads/develop'"
46- run : cd hyde && composer require hyde/framework:dev-${{ github.head_ref }} hyde/testing:dev-master
41+ # Since we can't use rsync on Windows, we need to copy the files to a temporary directory and then copy them back
42+ if [ "${{ matrix.os }}" == "windows-latest" ]; then
43+ mkdir ../temp
44+ cp -r ./ ../temp
45+ rm -rf ../temp/hyde
46+ cp -r ../temp/. ./hyde/packages/hyde/framework/src
47+ else
48+ rsync -a --exclude=hyde ./. ./hyde/packages/hyde/framework/src
49+ fi
4750
48- - name : Copy over test files
49- run : cp -r ./tests/. ./hyde/tests
51+ - name : Update composer.json to load framework from local source
52+ run : |
53+ cd hyde
54+ composer config repositories.framework path ./packages/hyde/framework
55+ composer require hyde/testing:dev-master hyde/framework:dev-develop
5056
5157 - name : Download test runner configuration
5258 run : cd hyde && curl https://raw.githubusercontent.com/hydephp/develop/master/packages/hyde/phpunit.xml.dist -o phpunit.xml.dist
0 commit comments