From 17b7f9d18e525bc3d1a5ab0ac2445829cac51d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Fri, 14 Jul 2023 08:36:36 +0200 Subject: [PATCH 1/5] ci: Update github actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- .github/workflows/integration.yml | 64 ++++++++++++++++++++++++++++--- .github/workflows/nightly.yml | 64 ------------------------------- 2 files changed, 59 insertions(+), 69 deletions(-) delete mode 100644 .github/workflows/nightly.yml diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index d7e0e12b4..231cfc02f 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -12,6 +12,7 @@ on: - 'composer.lock' push: branches: + - main - master - stable* @@ -70,16 +71,17 @@ jobs: path: apps/${{ env.APP_NAME }} - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@2.21.2 + uses: shivammathur/setup-php@2.25.4 with: php-version: ${{ matrix.php-versions }} - tools: phpunit - extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, mysql, pdo_mysql, pgsql, pdo_pgsql, + extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, mysql, pdo_mysql, pgsql, pdo_pgsql, apcu + ini-values: + apc.enable_cli=on coverage: none - - name: Set up PHPUnit + - name: Set up dependencies working-directory: apps/${{ env.APP_NAME }} - run: composer i + run: composer i --no-dev - name: Set up Nextcloud run: | @@ -90,11 +92,63 @@ jobs: fi mkdir data ./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 + ./occ config:system:set hashing_default_password --value=true --type=boolean + ./occ config:system:set memcache.local --value="\\OC\\Memcache\\APCu" + ./occ config:system:set memcache.distributed --value="\\OC\\Memcache\\APCu" cat config/config.php ./occ user:list ./occ app:enable --force ${{ env.APP_NAME }} + ./occ config:system:set query_log_file --value "$PWD/query.log" php -S localhost:8080 & - name: Run behat working-directory: apps/${{ env.APP_NAME }}/tests/integration run: ./run.sh + + - name: Query count + if: ${{ matrix.databases == 'mysql' }} + uses: actions/github-script@v6 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + let myOutput = '' + let myError = '' + + const options = {} + options.listeners = { + stdout: (data) => { + myOutput += data.toString() + }, + stderr: (data) => { + myError += data.toString() + } + } + await exec.exec(`/bin/bash -c "cat query.log | wc -l"`, [], options) + msg = myOutput + const queryCount = parseInt(myOutput, 10) + + myOutput = '' + await exec.exec('cat', ['apps/${{ env.APP_NAME }}/tests/integration/base-query-count.txt'], options) + const baseCount = parseInt(myOutput, 10) + + const absoluteIncrease = queryCount - baseCount + const relativeIncrease = baseCount <= 0 ? 100 : (parseInt((absoluteIncrease / baseCount * 10000), 10) / 100) + + if (absoluteIncrease >= 100 || relativeIncrease > 5) { + const comment = `🐢 Performance warning.\nIt looks like the query count of the integration tests increased with this PR.\nDatabase query count is now ` + queryCount + ' was ' + baseCount + ' (+' + relativeIncrease + '%)\nPlease check your code again. If you added a new test this can be expected and the base value in tests/integration/base-query-count.txt can be increased.' + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment + }) + } + if (queryCount < 100) { + const comment = `🐈 Performance messuring seems broken. Failed to get query count.` + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment + }) + } \ No newline at end of file diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml deleted file mode 100644 index 3643bd8c9..000000000 --- a/.github/workflows/nightly.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: Package nightly - -on: - push: - branches: - - nightly - schedule: - - cron: '0 1 * * *' # run at 2 AM UTC - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [14.x] - - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - name: Set up npm7 - run: npm i -g npm@7 - - name: Setup PHP - uses: shivammathur/setup-php@2.21.2 - with: - php-version: '7.4' - tools: composer - - name: install dependencies - run: | - wget https://github.com/ChristophWurst/krankerl/releases/download/v0.12.2/krankerl_0.12.2_amd64.deb - sudo dpkg -i krankerl_0.12.2_amd64.deb - - name: package - run: | - uname -a - RUST_BACKTRACE=1 krankerl --version - RUST_BACKTRACE=1 krankerl package - - name: Set git config - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git tag -f nightly - - name: Push tag - uses: juliushaertl/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - tags: true - force: true - - name: Create Release - id: create_release - uses: juliushaertl/action-release@master - with: - token: ${{ secrets.GITHUB_TOKEN }} - tag: nightly - files: ./build/artifacts/deck.tar.gz - name: Nightly build - body: | - Nightly release of deck - draft: false - prerelease: true - overwrite: true From df28ab764bd600f90af66ec926e13faca786d3ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Fri, 14 Jul 2023 08:56:21 +0200 Subject: [PATCH 2/5] ci: Adapt cypress for self-hosted runners MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- .github/workflows/cypress.yml | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 325e6b4b4..6fdb31d88 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -4,7 +4,7 @@ on: pull_request: push: branches: - - master + - main - stable* env: @@ -14,7 +14,7 @@ env: jobs: cypress: - runs-on: ubuntu-latest + runs-on: self-hosted strategy: fail-fast: false @@ -33,6 +33,11 @@ jobs: - name: Set up npm7 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 uses: actions/checkout@v3 with: @@ -51,11 +56,18 @@ jobs: with: 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 }} - uses: shivammathur/setup-php@2.21.2 + uses: shivammathur/setup-php@2.25.4 with: 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: apc.enable_cli=on coverage: none @@ -84,7 +96,7 @@ jobs: curl -v http://localhost:8081/index.php/login - name: Cypress run - uses: cypress-io/github-action@v4 + uses: cypress-io/github-action@v5 with: record: true parallel: false @@ -96,7 +108,7 @@ jobs: npm_package_name: ${{ env.APP_NAME }} - name: Upload test failure screenshots - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 if: failure() with: name: Upload screenshots @@ -104,7 +116,7 @@ jobs: retention-days: 5 - name: Upload nextcloud logs - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 if: failure() with: name: Upload nextcloud log From a8b3df63705038e3d484fa77dfe11a4788352e7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 20 Jul 2023 13:15:12 +0200 Subject: [PATCH 3/5] ci: Fix stylelint/eslint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/components/board/SharingTabSidebar.vue | 2 +- src/components/card/CommentItem.vue | 2 +- src/components/card/Description.vue | 4 ++-- src/components/cards/CardMenu.vue | 4 ++-- src/components/navigation/AppNavigationBoard.vue | 4 ++-- src/mixins/attachmentUpload.js | 2 +- stylelint.config.js | 2 ++ 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/components/board/SharingTabSidebar.vue b/src/components/board/SharingTabSidebar.vue index baf1de914..f5707c106 100644 --- a/src/components/board/SharingTabSidebar.vue +++ b/src/components/board/SharingTabSidebar.vue @@ -79,7 +79,7 @@ import { mapGetters, mapState } from 'vuex' import { getCurrentUser } from '@nextcloud/auth' import { showError, showSuccess } from '@nextcloud/dialogs' import { loadState } from '@nextcloud/initial-state' -import debounce from 'lodash/debounce' +import debounce from 'lodash/debounce.js' export default { name: 'SharingTabSidebar', diff --git a/src/components/card/CommentItem.vue b/src/components/card/CommentItem.vue index 17236639f..4e7474a25 100644 --- a/src/components/card/CommentItem.vue +++ b/src/components/card/CommentItem.vue @@ -70,7 +70,7 @@ import CommentForm from './CommentForm.vue' import { getCurrentUser } from '@nextcloud/auth' import md5 from 'blueimp-md5' import relativeDate from '../../mixins/relativeDate.js' -import ReplyIcon from 'vue-material-design-icons/Reply' +import ReplyIcon from 'vue-material-design-icons/Reply.vue' const AtMention = { name: 'AtMention', diff --git a/src/components/card/Description.vue b/src/components/card/Description.vue index c389fb421..fc06b75b0 100644 --- a/src/components/card/Description.vue +++ b/src/components/card/Description.vue @@ -83,7 +83,7 @@ import { NcActions, NcActionButton, NcModal } from '@nextcloud/vue' import { formatFileSize } from '@nextcloud/files' import { generateUrl } from '@nextcloud/router' import { mapState, mapGetters } from 'vuex' -import PaperclipIcon from 'vue-material-design-icons/Paperclip' +import PaperclipIcon from 'vue-material-design-icons/Paperclip.vue' const markdownIt = new MarkdownIt({ linkify: true, @@ -100,7 +100,7 @@ markdownIt.use(MarkdownItLinkAttributes, { export default { name: 'Description', components: { - VueEasymde: () => import('vue-easymde/dist/VueEasyMDE.common'), + VueEasymde: () => import('vue-easymde/dist/VueEasyMDE.common.js'), NcActions, NcActionButton, NcModal, diff --git a/src/components/cards/CardMenu.vue b/src/components/cards/CardMenu.vue index 95112684d..6df8ac73b 100644 --- a/src/components/cards/CardMenu.vue +++ b/src/components/cards/CardMenu.vue @@ -94,8 +94,8 @@ import { generateUrl } from '@nextcloud/router' import { getCurrentUser } from '@nextcloud/auth' import { showUndo } from '@nextcloud/dialogs' import '@nextcloud/dialogs/styles/toast.scss' -import ArchiveIcon from 'vue-material-design-icons/Archive' -import CardBulletedIcon from 'vue-material-design-icons/CardBulleted' +import ArchiveIcon from 'vue-material-design-icons/Archive.vue' +import CardBulletedIcon from 'vue-material-design-icons/CardBulleted.vue' export default { name: 'CardMenu', diff --git a/src/components/navigation/AppNavigationBoard.vue b/src/components/navigation/AppNavigationBoard.vue index ada08513d..dadbbccee 100644 --- a/src/components/navigation/AppNavigationBoard.vue +++ b/src/components/navigation/AppNavigationBoard.vue @@ -140,8 +140,8 @@