|
1 | 1 | name: Test application |
2 | 2 |
|
3 | 3 | on: |
4 | | - pull_request: |
5 | | - push: |
6 | | - branches: |
7 | | - - '[0-9]+.[0-9]+' |
8 | | - - '[0-9]+.x' |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - '[0-9]+.[0-9]+' |
| 8 | + - '[0-9]+.x' |
9 | 9 |
|
10 | 10 | jobs: |
11 | | - code-style: |
12 | | - runs-on: ubuntu-latest |
13 | | - |
14 | | - steps: |
15 | | - - name: Checkout project |
16 | | - uses: actions/checkout@v3 |
17 | | - |
18 | | - - name: Install and configure PHP |
19 | | - uses: shivammathur/setup-php@v2 |
20 | | - with: |
21 | | - coverage: none |
22 | | - php-version: 8.1 |
23 | | - |
24 | | - - name: Get composer cache directory |
25 | | - id: composer-cache-dir |
26 | | - run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
27 | | - |
28 | | - - name: Cache dependencies |
29 | | - uses: actions/cache@v2 |
30 | | - id: composer-cache |
31 | | - with: |
32 | | - path: ${{ steps.composer-cache-dir.outputs.dir }} |
33 | | - key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} |
34 | | - restore-keys: | |
35 | | - ${{ runner.os }}-composer- |
36 | | -
|
37 | | - - name: Install dependencies |
38 | | - run: composer install --no-interaction --prefer-dist |
39 | | - |
40 | | - - name: Check code style |
41 | | - run: vendor/bin/ecs |
42 | | - |
43 | | - phpstan: |
44 | | - runs-on: ubuntu-latest |
45 | | - |
46 | | - steps: |
47 | | - - name: Checkout project |
48 | | - uses: actions/checkout@v3 |
49 | | - |
50 | | - - name: Install and configure PHP |
51 | | - uses: shivammathur/setup-php@v2 |
52 | | - with: |
53 | | - coverage: none |
54 | | - php-version: 8.1 |
55 | | - |
56 | | - - name: Get composer cache directory |
57 | | - id: composer-cache-dir |
58 | | - run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
59 | | - |
60 | | - - name: Cache dependencies |
61 | | - uses: actions/cache@v2 |
62 | | - id: composer-cache |
63 | | - with: |
64 | | - path: ${{ steps.composer-cache-dir.outputs.dir }} |
65 | | - key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} |
66 | | - restore-keys: | |
67 | | - ${{ runner.os }}-composer- |
68 | | -
|
69 | | - - name: Install dependencies |
70 | | - run: composer install --no-interaction --prefer-dist |
71 | | - |
72 | | - - name: Run PHPStan |
73 | | - run: vendor/bin/phpstan analyse |
74 | | - |
75 | | - unit-test: |
76 | | - name: 'Run unit tests with php ${{ matrix.php-version }} with symfony ${{ matrix.symfony-version}}' |
77 | | - runs-on: ubuntu-latest |
78 | | - |
79 | | - strategy: |
80 | | - fail-fast: false |
81 | | - matrix: |
82 | | - include: |
83 | | - - php-version: '8.0' |
84 | | - symfony-version: '5.4.*' |
85 | | - |
86 | | - - php-version: '8.1' |
87 | | - symfony-version: '5.4.*' |
88 | | - |
89 | | - - php-version: '8.1' |
90 | | - symfony-version: '6.0.*' |
91 | | - |
92 | | - - php-version: '8.1' |
93 | | - symfony-version: '6.1.*' |
94 | | - |
95 | | - steps: |
96 | | - - name: Checkout project |
97 | | - uses: actions/checkout@v3 |
98 | | - |
99 | | - - name: Install and configure PHP |
100 | | - uses: shivammathur/setup-php@v2 |
101 | | - with: |
102 | | - coverage: pcov |
103 | | - php-version: ${{ matrix.php-version }} |
104 | | - |
105 | | - - name: Get composer cache directory |
106 | | - id: composer-cache-dir |
107 | | - run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
108 | | - |
109 | | - - name: Cache dependencies |
110 | | - uses: actions/cache@v2 |
111 | | - id: composer-cache |
112 | | - with: |
113 | | - path: ${{ steps.composer-cache-dir.outputs.dir }} |
114 | | - key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} |
115 | | - restore-keys: | |
116 | | - ${{ runner.os }}-composer- |
117 | | -
|
118 | | - - name: Install dependencies |
119 | | - run: | |
120 | | - composer validate --strict |
121 | | - composer require --no-update symfony/serializer:${{ matrix.symfony-version }} |
122 | | - composer install --no-interaction --prefer-dist |
123 | | -
|
124 | | - - name: Run tests |
125 | | - run: vendor/bin/phpunit --testsuite=unit --coverage-clover=coverage.xml |
126 | | - |
127 | | - functional-test: |
128 | | - name: 'Run functional tests' |
129 | | - runs-on: ubuntu-latest |
130 | | - |
131 | | - steps: |
132 | | - - name: Checkout project |
133 | | - uses: actions/checkout@v3 |
134 | | - |
135 | | - - name: Install and configure PHP |
136 | | - uses: shivammathur/setup-php@v2 |
137 | | - with: |
138 | | - coverage: none |
139 | | - php-version: 8.1 |
140 | | - |
141 | | - - name: Get composer cache directory |
142 | | - id: composer-cache-dir |
143 | | - run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
144 | | - |
145 | | - - name: Cache dependencies |
146 | | - uses: actions/cache@v2 |
147 | | - id: composer-cache |
148 | | - with: |
149 | | - path: ${{ steps.composer-cache-dir.outputs.dir }} |
150 | | - key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} |
151 | | - restore-keys: | |
152 | | - ${{ runner.os }}-composer- |
153 | | -
|
154 | | - - name: Install dependencies |
155 | | - run: composer install --no-interaction --prefer-dist |
156 | | - |
157 | | - - name: Setup OpenSearch |
158 | | - uses: ankane/setup-opensearch@v1 |
159 | | - with: |
160 | | - opensearch-version: '1.2' |
161 | | - |
162 | | - - name: Run tests |
163 | | - run: vendor/bin/phpunit --testsuite=functional |
| 11 | + code-style: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + steps: |
| 15 | + - name: Checkout project |
| 16 | + uses: actions/checkout@v3 |
| 17 | + |
| 18 | + - name: Install and configure PHP |
| 19 | + uses: shivammathur/setup-php@v2 |
| 20 | + with: |
| 21 | + coverage: none |
| 22 | + php-version: 8.1 |
| 23 | + |
| 24 | + - name: Get composer cache directory |
| 25 | + id: composer-cache-dir |
| 26 | + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
| 27 | + |
| 28 | + - name: Cache dependencies |
| 29 | + uses: actions/cache@v3 |
| 30 | + id: composer-cache |
| 31 | + with: |
| 32 | + path: ${{ steps.composer-cache-dir.outputs.dir }} |
| 33 | + key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} |
| 34 | + restore-keys: | |
| 35 | + ${{ runner.os }}-composer- |
| 36 | +
|
| 37 | + - name: Install dependencies |
| 38 | + run: composer install --no-interaction --prefer-dist |
| 39 | + |
| 40 | + - name: Check code style |
| 41 | + run: vendor/bin/ecs |
| 42 | + |
| 43 | + phpstan: |
| 44 | + runs-on: ubuntu-latest |
| 45 | + |
| 46 | + steps: |
| 47 | + - name: Checkout project |
| 48 | + uses: actions/checkout@v3 |
| 49 | + |
| 50 | + - name: Install and configure PHP |
| 51 | + uses: shivammathur/setup-php@v2 |
| 52 | + with: |
| 53 | + coverage: none |
| 54 | + php-version: 8.1 |
| 55 | + |
| 56 | + - name: Get composer cache directory |
| 57 | + id: composer-cache-dir |
| 58 | + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
| 59 | + |
| 60 | + - name: Cache dependencies |
| 61 | + uses: actions/cache@v3 |
| 62 | + id: composer-cache |
| 63 | + with: |
| 64 | + path: ${{ steps.composer-cache-dir.outputs.dir }} |
| 65 | + key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} |
| 66 | + restore-keys: | |
| 67 | + ${{ runner.os }}-composer- |
| 68 | +
|
| 69 | + - name: Install dependencies |
| 70 | + run: composer install --no-interaction --prefer-dist |
| 71 | + |
| 72 | + - name: Run PHPStan |
| 73 | + run: vendor/bin/phpstan analyse |
| 74 | + |
| 75 | + unit-test: |
| 76 | + name: 'Run unit tests with php ${{ matrix.php-version }} with symfony ${{ matrix.symfony-version}}' |
| 77 | + runs-on: ubuntu-latest |
| 78 | + |
| 79 | + strategy: |
| 80 | + fail-fast: false |
| 81 | + matrix: |
| 82 | + include: |
| 83 | + - php-version: '8.0' |
| 84 | + symfony-version: '5.4.*' |
| 85 | + |
| 86 | + - php-version: '8.1' |
| 87 | + symfony-version: '5.4.*' |
| 88 | + |
| 89 | + - php-version: '8.1' |
| 90 | + symfony-version: '6.0.*' |
| 91 | + |
| 92 | + - php-version: '8.1' |
| 93 | + symfony-version: '6.1.*' |
| 94 | + |
| 95 | + - php-version: '8.1' |
| 96 | + symfony-version: '6.2.*' |
| 97 | + |
| 98 | + steps: |
| 99 | + - name: Checkout project |
| 100 | + uses: actions/checkout@v3 |
| 101 | + |
| 102 | + - name: Install and configure PHP |
| 103 | + uses: shivammathur/setup-php@v2 |
| 104 | + with: |
| 105 | + coverage: pcov |
| 106 | + php-version: ${{ matrix.php-version }} |
| 107 | + |
| 108 | + - name: Get composer cache directory |
| 109 | + id: composer-cache-dir |
| 110 | + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
| 111 | + |
| 112 | + - name: Cache dependencies |
| 113 | + uses: actions/cache@v3 |
| 114 | + id: composer-cache |
| 115 | + with: |
| 116 | + path: ${{ steps.composer-cache-dir.outputs.dir }} |
| 117 | + key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} |
| 118 | + restore-keys: | |
| 119 | + ${{ runner.os }}-composer- |
| 120 | +
|
| 121 | + - name: Install dependencies |
| 122 | + run: | |
| 123 | + composer validate --strict |
| 124 | + composer require --no-update symfony/serializer:${{ matrix.symfony-version }} |
| 125 | + composer install --no-interaction --prefer-dist |
| 126 | +
|
| 127 | + - name: Run tests |
| 128 | + run: vendor/bin/phpunit --testsuite=unit --coverage-clover=coverage.xml |
| 129 | + |
| 130 | + functional-test: |
| 131 | + name: 'Run functional tests with OS ${{ matrix.opensearch-version }}' |
| 132 | + runs-on: ubuntu-latest |
| 133 | + |
| 134 | + strategy: |
| 135 | + fail-fast: false |
| 136 | + matrix: |
| 137 | + include: |
| 138 | + - opensearch-version: '1.3' |
| 139 | + opensearch-composer-version: '^1' |
| 140 | + - opensearch-version: '2.4' |
| 141 | + opensearch-composer-version: '^2' |
| 142 | + |
| 143 | + steps: |
| 144 | + - name: Checkout project |
| 145 | + uses: actions/checkout@v3 |
| 146 | + |
| 147 | + - name: Install and configure PHP |
| 148 | + uses: shivammathur/setup-php@v2 |
| 149 | + with: |
| 150 | + coverage: none |
| 151 | + php-version: 8.1 |
| 152 | + |
| 153 | + - name: Get composer cache directory |
| 154 | + id: composer-cache-dir |
| 155 | + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
| 156 | + |
| 157 | + - name: Cache dependencies |
| 158 | + uses: actions/cache@v3 |
| 159 | + id: composer-cache |
| 160 | + with: |
| 161 | + path: ${{ steps.composer-cache-dir.outputs.dir }} |
| 162 | + key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} |
| 163 | + restore-keys: | |
| 164 | + ${{ runner.os }}-composer- |
| 165 | +
|
| 166 | + - name: Install dependencies |
| 167 | + run: | |
| 168 | + composer require --no-update opensearch-project/opensearch-php:${{ matrix.opensearch-composer-version }} |
| 169 | + composer install --no-interaction --prefer-dist |
| 170 | +
|
| 171 | + - name: Setup OpenSearch |
| 172 | + uses: ankane/setup-opensearch@v1 |
| 173 | + with: |
| 174 | + opensearch-version: ${{ matrix.opensearch-version }} |
| 175 | + |
| 176 | + - name: Run tests |
| 177 | + run: vendor/bin/phpunit --testsuite=functional |
0 commit comments