Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/scripts/upgrade-integration-app.sh
Original file line number Diff line number Diff line change
@@ -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
145 changes: 85 additions & 60 deletions .github/workflows/shared_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/upgrade-testing.yml
Original file line number Diff line number Diff line change
@@ -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
Loading