summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2020-10-01 17:29:37 +0200
committerRobin Appelman <robin@icewind.nl>2020-10-01 19:53:33 +0200
commitd20d14cb42b53ea5322447da28618ec2d796ebc5 (patch)
tree3d43f257016378aeb92e24c10932d3d93f5de825 /.github
parentf77cf749c0ba5094c88e207b7b660ece8dd44cbe (diff)
add cypress testing
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/cypress.yml67
1 files changed, 67 insertions, 0 deletions
diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml
new file mode 100644
index 00000000..358d3f2e
--- /dev/null
+++ b/.github/workflows/cypress.yml
@@ -0,0 +1,67 @@
+name: Cypress
+
+on:
+ pull_request:
+ push:
+ branches:
+ - master
+ - stable*
+
+env:
+ APP_NAME: social
+ BRANCH: ${{ github.base_ref }}
+ CYPRESS_baseUrl: http://127.0.0.1:8082/index.php
+
+jobs:
+ cypress:
+ runs-on: ubuntu-latest
+
+ strategy:
+ fail-fast: false
+ matrix:
+ # run 2 copies of the current job in parallel
+ containers: [1, 2]
+ node-version: ['12']
+ php-versions: ['7.4']
+
+ name: Runner ${{ matrix.containers }}
+
+ steps:
+ - name: Checkout app
+ uses: actions/checkout@v2
+
+ - name: Setup server
+ run: |
+ cd cypress
+ docker-compose up -d
+ - name: Set up node ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node-version }}
+
+ - name: Install dependencies & build app
+ run: |
+ npm ci
+ composer install
+ TESTING=true npm run build --if-present
+ - name: Wait for server
+ run: |
+ npm install -g wait-on
+ wait-on -i 500 -t 240000 $CYPRESS_baseUrl
+
+ - name: Enable app & configure server
+ run: |
+ cd cypress
+ docker-compose exec --env APP_NAME=${{ env.APP_NAME }} -T nextcloud bash /initserver.sh
+ - name: Cypress run
+ uses: cypress-io/github-action@v1
+ with:
+ record: true
+ parallel: true
+ # cypress env
+ ci-build-id: ${{ github.sha }}-${{ github.run_number }}
+ tag: ${{ github.event_name }}
+ env:
+ CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
+ # https://github.com/cypress-io/github-action/issues/124
+ COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}