diff --git a/.github/scripts/upgrade-integration-app.sh b/.github/scripts/upgrade-integration-app.sh new file mode 100644 index 000000000..f03169a74 --- /dev/null +++ b/.github/scripts/upgrade-integration-app.sh @@ -0,0 +1,6 @@ +php occ maintenance:mode --on +php occ app:update --allow-unstable integration_openproject +php occ db:add-missing-columns +php occ db:add-missing-indices +php occ db:add-missing-primary-keys +php occ maintenance:mode --off \ No newline at end of file diff --git a/.github/workflows/shared_workflow.yml b/.github/workflows/shared_workflow.yml index ac03c1ddd..e99509def 100644 --- a/.github/workflows/shared_workflow.yml +++ b/.github/workflows/shared_workflow.yml @@ -19,61 +19,61 @@ on: name: CI jobs: - js-lint-unit: - name: js lint and unit tests - runs-on: ubuntu-22.04 - steps: - - name: Checkout - if: github.event_name != 'schedule' - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 - - - name: Checkout (Nightly) - if: github.event_name == 'schedule' - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 - with: - ref: ${{ inputs.branch }} - - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 - id: versions - with: - fallbackNode: '^20' - fallbackNpm: '^10' - - - name: Setup NodeJS ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 - with: - node-version: ${{ steps.versions.outputs.nodeVersion }} - cache: 'npm' - - - name: Setup NPM ${{ steps.versions.outputs.npmVersion }} - run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" - - - name: Install NPM Dependencies - run: npm install - - - name: JS Lint - run: make lint-js || ( echo 'Please run `make lint-js-fix` to format your code' && exit 1 ) - - - name: Vue Unit tests - run: | - make jsunit - - - name: JS Code Coverage Summary Report - if: ${{ github.event_name == 'pull_request' }} - uses: romeovs/lcov-reporter-action@dda1c9b1fa1622b225e9acd87a248751dbcc6ada - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - lcov-file: ./coverage/jest/lcov.info - delete-old-comments: true - title: "JS Code Coverage" - - - name: JS coverage check - if: ${{ github.event_name == 'pull_request' }} - uses: VeryGoodOpenSource/very_good_coverage@3b475421464c564c0714d92ce02742bd81fa9eda - with: - min_coverage: '59' - path: './coverage/jest/lcov.info' + # js-lint-unit: + # name: js lint and unit tests + # runs-on: ubuntu-22.04 + # steps: + # - name: Checkout + # if: github.event_name != 'schedule' + # uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 + + # - name: Checkout (Nightly) + # if: github.event_name == 'schedule' + # uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 + # with: + # ref: ${{ inputs.branch }} + + # - name: Read package.json node and npm engines version + # uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 + # id: versions + # with: + # fallbackNode: '^20' + # fallbackNpm: '^10' + + # - name: Setup NodeJS ${{ steps.versions.outputs.nodeVersion }} + # uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 + # with: + # node-version: ${{ steps.versions.outputs.nodeVersion }} + # cache: 'npm' + + # - name: Setup NPM ${{ steps.versions.outputs.npmVersion }} + # run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" + + # - name: Install NPM Dependencies + # run: npm install + + # - name: JS Lint + # run: make lint-js || ( echo 'Please run `make lint-js-fix` to format your code' && exit 1 ) + + # - name: Vue Unit tests + # run: | + # make jsunit + + # - name: JS Code Coverage Summary Report + # if: ${{ github.event_name == 'pull_request' }} + # uses: romeovs/lcov-reporter-action@dda1c9b1fa1622b225e9acd87a248751dbcc6ada + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} + # lcov-file: ./coverage/jest/lcov.info + # delete-old-comments: true + # title: "JS Code Coverage" + + # - name: JS coverage check + # if: ${{ github.event_name == 'pull_request' }} + # uses: VeryGoodOpenSource/very_good_coverage@3b475421464c564c0714d92ce02742bd81fa9eda + # with: + # min_coverage: '59' + # path: './coverage/jest/lcov.info' create-matrix: runs-on: ubuntu-22.04 @@ -148,11 +148,12 @@ jobs: options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - - name: Checkout + - name: Checkout (initial) if: github.event_name != 'schedule' uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 with: path: integration_openproject + ref: ${{ github.event.pull_request.base.ref }} - name: Checkout (Nightly) if: github.event_name == 'schedule' @@ -217,12 +218,36 @@ jobs: key: ${{ runner.os }}-composer-${{ hashFiles('./composer.lock') }} restore-keys: ${{ runner.os }}-composer- - - name: Install PHP dependencies - run: composer install --no-progress --prefer-dist --optimize-autoloader - - name: Prepare Nextcloud server (for phpunit and psalm) run: server/occ maintenance:install --admin-pass=admin + - name: Install PHP dependencies + run: | + composer install --no-progress --prefer-dist --optimize-autoloader + + - name: Enable integration_openproject app (for phpunit and psalm) + run: | + cd server + if [ "${{matrix.nextcloudVersion}}" == "master" ]; then + # enable app even if it is not compatible with the master branch + ./occ a:e -f integration_openproject + else + ./occ a:e integration_openproject + fi + + - name: Checkout integration_openproject app (release version for upgrade) + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 + with: + path: integration_openproject + + - name: Update integration_openproject app + run: | + pwd + ls + cd server + ./occ upgrade + ./occ app:update --allow-unstable integration_openproject + - name: PHP code analysis and linting run: | make psalm @@ -330,7 +355,7 @@ jobs: notify-nightly-report: needs: - - js-lint-unit + # - js-lint-unit - api-phpunit-tests if: ${{ always() && github.event_name == 'schedule' }} runs-on: ubuntu-22.04 diff --git a/.github/workflows/upgrade-testing.yml b/.github/workflows/upgrade-testing.yml new file mode 100644 index 000000000..9011005c1 --- /dev/null +++ b/.github/workflows/upgrade-testing.yml @@ -0,0 +1,66 @@ +# # SPDX-FileCopyrightText: 2023 Jankari Tech Pvt. Ltd. +# # SPDX-License-Identifier: AGPL-3.0-or-later +# name: Upgrade Testing + +# on: +# push: +# branches: +# - 'master' +# pull_request: +# paths-ignore: +# - '**.md' +# - '**.txt' +# - '**.sh' +# - 'dev/**' +# - 'l10n/**' +# - 'img/**' +# - 'docker-compose*' + +# jobs: +# builds: +# name: Build and Test +# runs-on: ubuntu-latest +# steps: +# - name: Checkout server (for phpunit and psalm) +# uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 +# with: +# submodules: true +# repository: nextcloud/server +# path: server +# ref: stable33 + +# - name: Checkout integration_openproject app (initial version) +# uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 +# with: +# repository: nextcloud/integration_openproject +# path: server/apps/integration_openproject +# ref: master # or the initial branch/tag before upgrade + +# - name: Install server and enable integration_openproject app +# run: | +# cd server/apps/integration_openproject +# php ../../occ maintenance:install --admin-pass=admin +# php ../../occ a:e integration_openproject + +# - name: Checkout integration_openproject app (release version for upgrade) +# uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 +# with: +# repository: nextcloud/integration_openproject +# path: server/apps/integration_openproject +# ref: release/3.0 # the version to upgrade to + +# - name: Update integration_openproject app +# working-directory: server/apps/integration_openproject +# run: | +# pwd +# ls +# php ../../occ upgrade +# php ../../occ app:update --allow-unstable integration_openproject + +# - name: API Tests +# env: +# NEXTCLOUD_BASE_URL: http://localhost +# run: | +# cd server/apps/integration_openproject +# ls +# make api-test \ No newline at end of file