File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+
2+ name : CI
3+
4+ on :
5+ workflow_call :
6+ inputs :
7+ php-versions :
8+ description : ' The php versions to test as JSON array. Will be converted and used to create a matrix.'
9+ default : ' ["8.1"]'
10+ required : true
11+ type : string
12+ prefer-stability :
13+ description : ' The staibility of the packages to use. Will be converted and used to create a matrix.'
14+ default : ' ["prefer-lowest", "prefer-stable"]'
15+ required : true
16+ type : string
17+ test-command :
18+ description : ' The command to run for executing tests'
19+ default : ' composer ci-all'
20+ required : true
21+ type : string
22+
23+ concurrency :
24+ group : ${{ github.workflow }}-${{ github.ref_name }}
25+ cancel-in-progress : true
26+
27+ jobs :
28+ test :
29+ strategy :
30+ matrix :
31+ php-versions : ${{fromJSON(input.php-versions)}}
32+ prefer : ${{fromJSON(input.prefer-stability)}}
33+ name : Test with ${{ matrix.prefer }} dependency versions on PHP ${{ matrix.php-versions }}
34+ runs-on : ubuntu-latest
35+
36+ steps :
37+ - name : Checkout
38+ uses : actions/checkout@v2
39+
40+ - name : Setup PHP
41+ uses : shivammathur/setup-php@v2
42+ with :
43+ php-version : ${{ matrix.php-versions }}
44+ coverage : xdebug
45+
46+ - name : Validate composer.json
47+ run : composer validate
48+
49+ - name : Get Composer Cache Directory
50+ id : composer-cache
51+ run : echo "::set-output name=dir::$(composer config cache-files-dir)"
52+ - name : Setup cache
53+ uses : actions/cache@v2
54+ with :
55+ path : ${{ steps.composer-cache.outputs.dir }}
56+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.prefer }}-
57+ restore-keys : ${{ runner.os }}-composer-${{ matrix.prefer }}-
58+
59+ - name : Install dependencies
60+ if : steps.composer-cache.outputs.cache-hit != 'true'
61+ run : composer update --prefer-dist --no-ansi --no-interaction --no-progress --${{ matrix.prefer }}
62+
63+ - name : Run CI tools
64+ run : ${{inputs.test-command}}
You can’t perform that action at this time.
0 commit comments