1+ name : " Tests"
2+
3+ on :
4+ pull_request :
5+ push :
6+ branches :
7+ - " 1.x"
8+ schedule :
9+ - cron : ' * 8 * * *'
10+
11+ jobs :
12+ tests :
13+ name : " Tests"
14+
15+ runs-on : ${{ matrix.operating-system }}
16+
17+ services :
18+ elasticsearch :
19+ image : elasticsearch:7.12.0
20+ env :
21+ discovery.type : single-node
22+ options : >-
23+ --health-cmd "curl http://localhost:9200/_cluster/health"
24+ --health-interval 10s
25+ --health-timeout 5s
26+ --health-retries 10
27+ ports :
28+ - 9200:9200
29+
30+ strategy :
31+ matrix :
32+ dependencies :
33+ - " locked"
34+ - " lowest"
35+ - " highest"
36+ php-version :
37+ - " 7.4"
38+ operating-system :
39+ - " ubuntu-latest"
40+ - " windows-latest"
41+
42+ steps :
43+ - name : " Checkout"
44+ uses : " actions/checkout@v2"
45+
46+ - name : " Install PHP"
47+ uses : " shivammathur/setup-php@v2"
48+ with :
49+ coverage : pcov
50+ tools : composer:v2
51+ php-version : " ${{ matrix.php-version }}"
52+ ini-values : memory_limit=-1
53+
54+ - name : " Get Composer Cache Directory"
55+ id : composer-cache
56+ run : |
57+ echo "::set-output name=dir::$(composer config cache-files-dir)"
58+
59+ - name : " Cache Composer dependencies"
60+ uses : " actions/cache@v2"
61+ with :
62+ path : |
63+ ${{ steps.composer-cache.outputs.dir }}
64+ key : " php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.lock') }}"
65+ restore-keys : |
66+ php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-
67+
68+ - name : " Install lowest dependencies"
69+ if : ${{ matrix.dependencies == 'lowest' }}
70+ run : " composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
71+
72+ - name : " Install highest dependencies"
73+ if : ${{ matrix.dependencies == 'highest' }}
74+ run : " composer update --no-interaction --no-progress --no-suggest"
75+
76+ - name : " Install locked dependencies"
77+ if : ${{ matrix.dependencies == 'locked' }}
78+ run : " composer install --no-interaction --no-progress --no-suggest"
79+
80+ - name : " Install tools"
81+ run : " composer install --no-interaction --no-progress --no-suggest"
82+ working-directory : " ./tools"
83+
84+ - name : " Test"
85+ run : " composer test"
0 commit comments