13
13
description : The PHP version the workflow should run
14
14
type : string
15
15
required : true
16
+ os :
17
+ description : The GitHub-hosted runner for the job
18
+ type : string
19
+ required : true
16
20
job-id :
17
21
description : Job ID to be used as part of cache key and artifact name
18
22
type : string
49
53
jobs :
50
54
tests :
51
55
name : ${{ inputs.job-name }}
52
- runs-on : ubuntu-22.04
56
+ runs-on : ${{ inputs.os }}
53
57
54
58
steps :
59
+ - name : Set Git to use LF
60
+ if : ${{ contains(inputs.os, 'windows') }}
61
+ run : |
62
+ git config --global core.autocrlf false
63
+ git config --global core.eol lf
64
+
55
65
- name : Install latest ImageMagick
56
66
if : ${{ contains(inputs.extra-extensions, 'imagick') }}
57
67
run : |
@@ -68,22 +78,24 @@ jobs:
68
78
with :
69
79
php-version : ${{ inputs.php-version }}
70
80
tools : composer
71
- extensions : gd, ${{ inputs.extra-extensions }}
81
+ extensions : intl, gd, ${{ inputs.extra-extensions }}
72
82
coverage : ${{ env.COVERAGE_DRIVER }}
73
83
env :
74
84
COVERAGE_DRIVER : ${{ inputs.enable-coverage && 'xdebug' || 'none' }}
75
85
76
86
- name : Setup global environment variables
77
87
run : |
78
88
echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
79
- echo "ARTIFACT_NAME=${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}" >> $GITHUB_ENV
89
+ echo "ARTIFACT_NAME=${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-os-${{ inputs.os }}" >> $GITHUB_ENV
90
+ shell : bash
80
91
81
92
- name : Cache Composer dependencies
82
93
uses : actions/cache@v3
83
94
with :
84
95
path : ${{ env.COMPOSER_CACHE_FILES_DIR }}
85
- key : ${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-${{ hashFiles('**/composer.*') }}
96
+ key : ${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-os-${{ inputs.os }}- ${{ hashFiles('**/composer.*') }}
86
97
restore-keys : |
98
+ ${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-os-${{ inputs.os }}-
87
99
${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-
88
100
${{ inputs.job-id || github.job }}-
89
101
@@ -109,7 +121,7 @@ jobs:
109
121
GROUP_OPTION : ${{ inputs.group-name && format('--group {0}', inputs.group-name) || '' }}
110
122
111
123
- name : Run tests
112
- run : script -e -c " vendor/bin/phpunit --color=always ${{ env.EXTRA_PHPUNIT_OPTIONS }}"
124
+ run : vendor/bin/phpunit --color=always ${{ env.EXTRA_PHPUNIT_OPTIONS }}
113
125
env :
114
126
TACHYCARDIA_MONITOR_GA : ${{ inputs.enable-profiling && 'enabled' || '' }}
115
127
TERM : xterm-256color
0 commit comments