Migrate to Vue 3 and nextcloud/vue 9 #265
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow is provided via the organization template repository | |
| # | |
| # https://github.com/nextcloud/.github | |
| # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization | |
| # | |
| # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors | |
| # SPDX-License-Identifier: MIT | |
| name: Integration test | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| - stable* | |
| env: | |
| APP_NAME: integration_dropbox | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: integration-test-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| # do not stop on another job's failure | |
| fail-fast: false | |
| matrix: | |
| php-versions: [ '8.2' ] | |
| server-versions: [ 'master', 'stable32', 'stable31', 'stable30' ] | |
| name: Integration test | |
| steps: | |
| - name: Checkout nextcloud | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| path: server | |
| repository: nextcloud/server | |
| ref: ${{ matrix.server-versions }} | |
| - name: Set up php | |
| uses: shivammathur/setup-php@cf4cade2721270509d5b1c766ab3549210a39a2a # v2 | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| coverage: none | |
| ini-file: development | |
| # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation | |
| extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, mysql, pdo_mysql | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install nextcloud | |
| working-directory: server/ | |
| run: | | |
| git submodule update --init | |
| php occ maintenance:install --verbose --admin-user admin --admin-pass admin | |
| - name: Prepare config (will be encrypted by migration) | |
| working-directory: server/ | |
| env: | |
| DROPBOX_CONFIG: ${{ secrets.DROPBOX_CONFIG }} | |
| OAUTH_CLIENT_ID: ${{ secrets.OAUTH_CLIENT_ID }} | |
| OAUTH_CLIENT_SECRET: ${{ secrets.OAUTH_CLIENT_SECRET }} | |
| run: | | |
| echo $DROPBOX_CONFIG > config.json | |
| sudo apt install jq sqlite3 | |
| sqlite3 data/owncloud.db "INSERT INTO oc_preferences ( userid, appid, configkey, configvalue) VALUES ('admin', 'integration_dropbox', 'account_id', $(cat config.json | jq '.config.account_id'));" | |
| sqlite3 data/owncloud.db "INSERT INTO oc_preferences ( userid, appid, configkey, configvalue) VALUES ('admin', 'integration_dropbox', 'token', $(cat config.json | jq '.config.token'));" | |
| sqlite3 data/owncloud.db "INSERT INTO oc_preferences ( userid, appid, configkey, configvalue) VALUES ('admin', 'integration_dropbox', 'refresh_token', $(cat config.json | jq '.config.refresh_token'));" | |
| sqlite3 data/owncloud.db "INSERT INTO oc_preferences ( userid, appid, configkey, configvalue) VALUES ('admin', 'integration_dropbox', 'importing_dropbox', '1');" | |
| sqlite3 data/owncloud.db "INSERT INTO oc_appconfig ( appid, configkey, configvalue) VALUES ('integration_dropbox', 'client_id', '$OAUTH_CLIENT_ID');" | |
| sqlite3 data/owncloud.db "INSERT INTO oc_appconfig ( appid, configkey, configvalue) VALUES ('integration_dropbox', 'client_secret', '$OAUTH_CLIENT_SECRET');" | |
| - name: Checkout app | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| path: server/apps/${{ env.APP_NAME }} | |
| - name: Install dependencies | |
| working-directory: server/apps/${{ env.APP_NAME }} | |
| run: composer i | |
| - name: Install app | |
| working-directory: server/ | |
| run: | | |
| php occ app:enable integration_dropbox -vvv | |
| # for good measure | |
| sed -i '$d' config/config.php && echo " 'debug' => true," >> config/config.php && echo ");" >> config/config.php | |
| php occ migrations:execute integration_dropbox 030002Date20241021105515 | |
| - name: Run Nextcloud | |
| working-directory: server/ | |
| run: php -S localhost:8080 & | |
| - name: Run import | |
| working-directory: server/ | |
| run: | | |
| php occ integration_dropbox:start-import admin | |
| for run in {1..10}; do date; echo "run $run starting"; php cron.php; ls -lh data/admin/files/Dropbox\ import/ ; echo "run $run done"; done | |
| date | |
| du -shc data/admin/files/Dropbox\ import/* | |
| - name: Check import result | |
| if: always() | |
| working-directory: server/ | |
| run: | | |
| sqlite3 data/owncloud.db "SELECT * from oc_preferences where configkey = 'nb_imported_files';" > result.txt | |
| sqlite3 data/owncloud.db "SELECT * from oc_preferences where configkey = 'importing_dropbox';" >> result.txt | |
| sqlite3 data/owncloud.db "SELECT * from oc_preferences where configkey = 'last_import_error';" >> result.txt | |
| cat > result.expected.txt <<- EOM | |
| admin|integration_dropbox|nb_imported_files|0 | |
| admin|integration_dropbox|importing_dropbox|0 | |
| admin|integration_dropbox|last_import_error| | |
| EOM | |
| cat > result.nc31.expected.txt <<- EOM | |
| admin|integration_dropbox|nb_imported_files|0|0|0|0| | |
| admin|integration_dropbox|importing_dropbox|0|0|0|0| | |
| admin|integration_dropbox|last_import_error||0|0|0| | |
| EOM | |
| diff result.expected.txt result.txt || diff result.nc31.expected.txt result.txt | |
| cat > du-sh.expected.txt <<- EOM | |
| 1.6G data/admin/files/Dropbox import/ | |
| EOM | |
| echo CHECK "du -shc --apparent-size data/admin/files/Dropbox\ import/*" | |
| du -shc --apparent-size data/admin/files/Dropbox\ import/* | |
| echo CHECK "md5sum data/admin/files/Dropbox\ import/*" | |
| md5sum data/admin/files/Dropbox\ import/* | |
| echo END CHECKS | |
| du -sh --apparent-size data/admin/files/Dropbox\ import/ | diff du-sh.expected.txt - | |
| - name: Show log on failure | |
| working-directory: server/ | |
| if: always() | |
| run: | | |
| du -sh data/admin/files/Dropbox\ import/ | |
| cat result.txt || echo "No result" | |
| tail data/nextcloud.log |