|
| 1 | +name: Cypress |
| 2 | + |
| 3 | +on: [push] |
| 4 | + |
| 5 | +env: |
| 6 | + APP_NAME: activity |
| 7 | + CYPRESS_baseUrl: http://localhost:8081/index.php |
| 8 | + |
| 9 | +jobs: |
| 10 | + cypress: |
| 11 | + |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + node-version: [12.x] |
| 18 | + # containers: [1, 2, 3] |
| 19 | + php-versions: [ '7.4' ] |
| 20 | + databases: [ 'sqlite' ] |
| 21 | + server-versions: [ 'master' ] |
| 22 | + |
| 23 | + steps: |
| 24 | + - name: Checkout server |
| 25 | + uses: actions/checkout@v2 |
| 26 | + with: |
| 27 | + repository: nextcloud/server |
| 28 | + ref: ${{ matrix.server-versions }} |
| 29 | + |
| 30 | + - name: Checkout submodules |
| 31 | + shell: bash |
| 32 | + run: | |
| 33 | + auth_header="$(git config --local --get http.https://github.com/.extraheader)" |
| 34 | + git submodule sync --recursive |
| 35 | + git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 |
| 36 | +
|
| 37 | + - name: Checkout ${{ env.APP_NAME }} |
| 38 | + uses: actions/checkout@v2 |
| 39 | + with: |
| 40 | + path: apps/${{ env.APP_NAME }} |
| 41 | + |
| 42 | + - name: Set up php ${{ matrix.php-versions }} |
| 43 | + uses: shivammathur/setup-php@v2 |
| 44 | + with: |
| 45 | + php-version: ${{ matrix.php-versions }} |
| 46 | + extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, zip, gd, apcu |
| 47 | + coverage: none |
| 48 | + |
| 49 | + - name: Set up Nextcloud |
| 50 | + env: |
| 51 | + DB_PORT: 4444 |
| 52 | + PHP_CLI_SERVER_WORKERS: 10 |
| 53 | + run: | |
| 54 | + mkdir data |
| 55 | + 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 |
| 56 | + php occ config:system:set memcache.local --value="\\OC\\Memcache\\APCu" |
| 57 | + php -f index.php |
| 58 | + php -S 0.0.0.0:8081 & |
| 59 | + export OC_PASS=1234561 |
| 60 | + php occ user:add --password-from-env user1 |
| 61 | + php occ user:add --password-from-env user2 |
| 62 | + php occ config:system:set force_language --value en |
| 63 | + php occ app:enable activity |
| 64 | + php occ app:list |
| 65 | + curl -v http://localhost:8081/index.php/login |
| 66 | + cat data/nextcloud.log |
| 67 | +
|
| 68 | + - name: Cypress run |
| 69 | + uses: cypress-io/github-action@v2 |
| 70 | + with: |
| 71 | + record: false # disabled for now as we have no way to savely use the token in our org |
| 72 | + parallel: false |
| 73 | + wait-on: '${{ env.CYPRESS_baseUrl }}' |
| 74 | + working-directory: 'apps/${{ env.APP_NAME }}' |
| 75 | + env: |
| 76 | + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} |
0 commit comments