99
1010env :
1111 APP_NAME : viewer
12- CYPRESS_baseUrl : http://127.0.0.1:8080/index.php
12+ BRANCH : ${{ github.base_ref }}
13+ CYPRESS_baseUrl : http://127.0.0.1:8081/index.php
1314
1415jobs :
1516 cypress :
@@ -24,63 +25,52 @@ jobs:
2425 php-versions : ['7.4']
2526
2627 name : Runner ${{ matrix.containers }}
28+
2729 steps :
28- - name : Checkout server
30+ - name : Checkout app
2931 uses : actions/checkout@v2
30- with :
31- repository : nextcloud/server
32- ref : ${{ github.base_ref }}
3332
34- - name : Checkout submodules
35- shell : bash
33+ - name : Pulling server
3634 run : |
37- auth_header="$(git config --local --get http.https://github.com/.extraheader)"
38- git submodule sync --recursive
39- git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
35+ cd cypress
36+ docker-compose pull
4037
41- - name : Checkout app
42- uses : actions/checkout@v2
43- with :
44- path : apps/${{ env.APP_NAME }}
38+ - name : Caching server
39+ uses : satackey/action-docker-layer-caching@v0.0.8
40+ # Ignore the failure of a step and avoid terminating the job.
41+ continue-on-error : true
42+
43+ - name : Setup server
44+ run : |
45+ cd cypress
46+ docker-compose up -d
4547
4648 - name : Set up node ${{ matrix.node-version }}
4749 uses : actions/setup-node@v1
4850 with :
4951 node-version : ${{ matrix.node-version }}
5052
5153 - name : Install dependencies & build app
52- working-directory : apps/${{ env.APP_NAME }}
5354 run : |
5455 npm ci
5556 TESTING=true npm run build --if-present
5657
57- - name : Set up php ${{ matrix.php-versions }}
58- uses : shivammathur/setup-php@v1
59- with :
60- php-version : ${{ matrix.php-versions }}
61- tools : phpunit
62- extensions : mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite
63- coverage : none
64-
65- - name : Set up Nextcloud
66- run : |
67- mkdir data
68- ./occ maintenance:install --verbose --database sqlite --admin-user admin --admin-pass admin
69- ./occ app:enable $APP_NAME
70- php -S 0.0.0.0:8080 &
71-
7258 - name : Wait for server
7359 run : |
7460 npm install -g wait-on
7561 wait-on -i 500 -t 240000 $CYPRESS_baseUrl
62+
63+ - name : Enable app & configure server
64+ run : |
65+ cd cypress
66+ docker-compose exec -T nextcloud --env APP_NAME=${{ env.APP_NAME }} bash /initserver.sh
7667
7768 - name : Cypress run
7869 uses : cypress-io/github-action@v1
7970 with :
8071 record : true
8172 parallel : true
8273 # cypress env
83- working-directory : apps/${{ env.APP_NAME }}
8474 ci-build-id : ${{ github.sha }}-${{ github.run_number }}
8575 tag : ${{ github.event_name }}
8676 env :
0 commit comments