diff options
Diffstat (limited to '.github/workflows/cypress.yml')
-rw-r--r-- | .github/workflows/cypress.yml | 95 |
1 files changed, 69 insertions, 26 deletions
diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 96b282c07..ea00e6f19 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -2,39 +2,82 @@ name: Cypress on: [push] +env: + APP_NAME: text + CYPRESS_baseUrl: http://localhost:8081/index.php + jobs: - build: + cypress: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: node-version: [12.x] containers: [1, 2, 3] + php-versions: [ '7.4' ] + databases: [ 'sqlite' ] + server-versions: [ 'master' ] steps: - - name: Checkout text app - uses: actions/checkout@v2 - - name: Build the stack - run: | - cd cypress/ - docker-compose up -d - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: Wait for server - env: - CYPRESS_baseUrl: http://localhost:8081/index.php - run: | - npm install -g wait-on - wait-on -i 500 -t 240000 $CYPRESS_baseUrl || (cd cypress && docker-compose logs && exit 1) - cd cypress/ && docker-compose exec -T nextcloud bash /var/www/html/apps/text/cypress/server.sh - - name: Cypress run - uses: cypress-io/github-action@v1 - with: - record: true - parallel: true - env: - CYPRESS_baseUrl: http://localhost:8081/index.php - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + - name: Checkout server + uses: actions/checkout@v2 + with: + repository: nextcloud/server + ref: ${{ matrix.server-versions }} + + - name: Checkout submodules + shell: bash + run: | + auth_header="$(git config --local --get http.https://github.com/.extraheader)" + git submodule sync --recursive + git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 + + - name: Checkout viewer + uses: actions/checkout@v2 + with: + repository: nextcloud/viewer + ref: ${{ matrix.server-versions }} + path: apps/viewer + + - name: Checkout ${{ env.APP_NAME }} + uses: actions/checkout@v2 + with: + path: apps/${{ env.APP_NAME }} + + + - name: Set up php ${{ matrix.php-versions }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite + coverage: none + + - name: Set up Nextcloud + env: + DB_PORT: 4444 + PHP_CLI_SERVER_WORKERS: 10 + run: | + mkdir data + php occ maintenance:install --verbose --database=${{ matrix.databases }} --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin + php occ config:system:set memcache.local --value="\\OC\\Memcache\\APCu" + php -f index.php + php -S 0.0.0.0:8081 & + export OC_PASS=1234561 + php occ user:add --password-from-env user1 + php occ user:add --password-from-env user2 + php occ config:system:set force_language --value en + php occ app:enable viewer + php occ app:enable text + php occ app:list + + - name: Cypress run + uses: cypress-io/github-action@v2 + with: + record: true + parallel: true + wait-on: '${{ env.CYPRESS_baseUrl }}' + working-directory: 'apps/${{ env.APP_NAME }}' + env: + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} |