11name : Test
22
33on :
4- # pull_request:
5- # branches: [main, dev]
6- # types: [opened, reopened, edited, synchronize]
7- # push:
8- # branches: [dev, main]
4+ pull_request :
5+ branches : [main]
6+ types : [opened, reopened, edited, synchronize]
7+ paths :
8+ - ' lib/*.*'
9+ - ' src/*.*'
10+ - ' templates/*.*'
11+ - ' tests/Unit/**'
12+ - ' tests/Integration/**'
13+ - ' tests/javascript/**'
14+ push :
15+ branches : [main]
16+ paths :
17+ - ' lib/*.*'
18+ - ' src/*.*'
19+ - ' templates/*.*'
20+ - ' tests/Unit/**'
21+ - ' tests/Integration/**'
22+ - ' tests/javascript/**'
923 workflow_dispatch :
1024
1125env :
1226 # Location of the phpunit.xml and phpunit.integration.xml files
1327 PHPUNIT_CONFIG : ./tests/phpunit.xml
1428 PHPUNIT_INTEGRATION_CONFIG : ./tests/phpunit.integration.xml
15- APP_NAME : mediadc
29+ APP_NAME : cloud_py_api
1630
1731jobs :
1832 phpunit-mysql :
3347 options : --health-cmd="mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 5
3448
3549 steps :
36- - name : Set app env
37- run : |
38- # Split and keep last
39- echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
40-
41- - name : Enable ONLY_FULL_GROUP_BY MySQL option
42- run : |
43- echo "SET GLOBAL sql_mode=(SELECT CONCAT(@@sql_mode,',ONLY_FULL_GROUP_BY'));" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword
44- echo "SELECT @@sql_mode;" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword
45-
4650 - name : Checkout server
4751 uses : actions/checkout@v3
4852 with :
@@ -122,11 +126,6 @@ jobs:
122126 options : --health-cmd pg_isready --health-interval 5s --health-timeout 2s --health-retries 5
123127
124128 steps :
125- - name : Set app env
126- run : |
127- # Split and keep last
128- echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
129-
130129 - name : Checkout server
131130 uses : actions/checkout@v3
132131 with :
@@ -188,87 +187,6 @@ jobs:
188187 working-directory : apps/${{ env.APP_NAME }}
189188 run : ./vendor/phpunit/phpunit/phpunit -c ${{ env.PHPUNIT_INTEGRATION_CONFIG }}
190189
191- # phpunit-oci:
192- # runs-on: ubuntu-20.04
193-
194- # strategy:
195- # matrix:
196- # php-versions: ["8.0"]
197- # server-versions: ["master"]
198-
199- # services:
200- # oracle:
201- # image: deepdiver/docker-oracle-xe-11g # 'wnameless/oracle-xe-11g-r2'
202- # ports:
203- # - 1521:1521/tcp
204-
205- # steps:
206- # - name: Set app env
207- # run: |
208- # # Split and keep last
209- # echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
210-
211- # - name: Checkout server
212- # uses: actions/checkout@v3
213- # with:
214- # submodules: true
215- # repository: nextcloud/server
216- # ref: ${{ matrix.server-versions }}
217-
218- # - name: Checkout app
219- # uses: actions/checkout@v3
220- # with:
221- # path: apps/${{ env.APP_NAME }}
222-
223- # - name: Set up php ${{ matrix.php-versions }}
224- # uses: shivammathur/setup-php@v2
225- # with:
226- # php-version: ${{ matrix.php-versions }}
227- # extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, oci8
228- # tools: phpunit
229- # coverage: none
230-
231- # - name: Set up PHPUnit
232- # working-directory: apps/${{ env.APP_NAME }}
233- # run: composer i
234-
235- # - name: Set up Nextcloud
236- # env:
237- # DB_PORT: 1521
238- # run: |
239- # mkdir data
240- # ./occ maintenance:install --verbose --database=oci --database-name=XE --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=autotest --database-pass=owncloud --admin-user admin --admin-pass admin
241- # ./occ app:enable ${{ env.APP_NAME }}
242-
243- # - name: Check PHPUnit config file existence
244- # id: check_phpunit
245- # uses: andstor/file-existence-action@v2
246- # with:
247- # files: apps/${{ env.APP_NAME }}/${{ env.PHPUNIT_CONFIG }}
248-
249- # - name: PHPUnit
250- # # Only run if phpunit config file exists
251- # if: steps.check_phpunit.outputs.files_exists == 'true'
252- # working-directory: apps/${{ env.APP_NAME }}
253- # run: ./vendor/phpunit/phpunit/phpunit -c ${{ env.PHPUNIT_CONFIG }}
254-
255- # - name: Check PHPUnit integration config file existence
256- # id: check_integration
257- # uses: andstor/file-existence-action@v2
258- # with:
259- # files: apps/${{ env.APP_NAME }}/${{ env.PHPUNIT_INTEGRATION_CONFIG }}
260-
261- # - name: Run Nextcloud
262- # # Only run if phpunit integration config file exists
263- # if: steps.check_integration.outputs.files_exists == 'true'
264- # run: php -S localhost:8080 &
265-
266- # - name: PHPUnit integration
267- # # Only run if phpunit integration config file exists
268- # if: steps.check_integration.outputs.files_exists == 'true'
269- # working-directory: apps/${{ env.APP_NAME }}
270- # run: ./vendor/phpunit/phpunit/phpunit -c ${{ env.PHPUNIT_INTEGRATION_CONFIG }}
271-
272190 phpunit-summary :
273191 runs-on : ubuntu-latest
274192 needs : [phpunit-mysql, phpunit-pgsql]
@@ -285,13 +203,20 @@ jobs:
285203 runs-on : ubuntu-latest
286204
287205 steps :
206+ - name : Checkout app
207+ uses : actions/checkout@v3
208+ with :
209+ path : apps/${{ env.APP_NAME }}
210+
288211 - name : Setup Node
289212 uses : actions/setup-node@v3
290213 with :
291214 node-version : 16.x
292215
293216 - name : Install dependencies
217+ working-directory : apps/${{ env.APP_NAME }}
294218 run : npm ci
295219
296220 - name : Run unit tests
221+ working-directory : apps/${{ env.APP_NAME }}
297222 run : npm run test
0 commit comments