ci: Adapt cypress for self-hosted runners

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2023-07-14 08:56:21 +02:00
parent 17b7f9d18e
commit df28ab764b

View File

@@ -4,7 +4,7 @@ on:
pull_request: pull_request:
push: push:
branches: branches:
- master - main
- stable* - stable*
env: env:
@@ -14,7 +14,7 @@ env:
jobs: jobs:
cypress: cypress:
runs-on: ubuntu-latest runs-on: self-hosted
strategy: strategy:
fail-fast: false fail-fast: false
@@ -33,6 +33,11 @@ jobs:
- name: Set up npm7 - name: Set up npm7
run: npm i -g npm@7 run: npm i -g npm@7
- name: Register text Git reference
run: |
text_app_ref="$(if [ "${{ matrix.server-versions }}" = "master" ]; then echo -n "main"; else echo -n "${{ matrix.server-versions }}"; fi)"
echo "text_app_ref=$text_app_ref" >> $GITHUB_ENV
- name: Checkout server - name: Checkout server
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
@@ -51,11 +56,18 @@ jobs:
with: with:
path: apps/${{ env.APP_NAME }} path: apps/${{ env.APP_NAME }}
- name: Checkout text
uses: actions/checkout@v3
with:
repository: nextcloud/text
ref: ${{ env.text_app_ref }}
path: apps/text
- name: Set up php ${{ matrix.php-versions }} - name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@2.21.2 uses: shivammathur/setup-php@2.25.4
with: with:
php-version: ${{ matrix.php-versions }} php-version: ${{ matrix.php-versions }}
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, zip, gd, apcu extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
ini-values: ini-values:
apc.enable_cli=on apc.enable_cli=on
coverage: none coverage: none
@@ -84,7 +96,7 @@ jobs:
curl -v http://localhost:8081/index.php/login curl -v http://localhost:8081/index.php/login
- name: Cypress run - name: Cypress run
uses: cypress-io/github-action@v4 uses: cypress-io/github-action@v5
with: with:
record: true record: true
parallel: false parallel: false
@@ -96,7 +108,7 @@ jobs:
npm_package_name: ${{ env.APP_NAME }} npm_package_name: ${{ env.APP_NAME }}
- name: Upload test failure screenshots - name: Upload test failure screenshots
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v3
if: failure() if: failure()
with: with:
name: Upload screenshots name: Upload screenshots
@@ -104,7 +116,7 @@ jobs:
retention-days: 5 retention-days: 5
- name: Upload nextcloud logs - name: Upload nextcloud logs
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v3
if: failure() if: failure()
with: with:
name: Upload nextcloud log name: Upload nextcloud log