1+ # This workflow is provided via the organization template repository
2+ #
3+ # https://github.com/nextcloud/.github
4+ # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
6+ # SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. <https://fsfe.org>
7+ #
8+ # SPDX-License-Identifier: CC0-1.0
9+
10+ name : Upgrade Testing
11+
12+ on : [pull_request]
13+
14+ jobs :
15+ build :
16+ runs-on : ubuntu-latest
17+ env :
18+ DJANGO_SETTINGS_MODULE : nextcloudappstore.settings.development
19+ services :
20+
21+ database-mysql :
22+ image : ghcr.io/nextcloud/continuous-integration-mariadb-10.5:latest
23+ env :
24+ MYSQL_ROOT_PASSWORD : ' nextcloud'
25+ MYSQL_PASSWORD : ' nextcloud'
26+ MYSQL_USER : ' nextcloud'
27+ MYSQL_DATABASE : ' nextcloud'
28+ ports :
29+ - 3306:3306
30+
31+ steps :
32+ - name : Setup NodeJS
33+ uses : actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238
34+ with :
35+ node-version : 20
36+
37+ - name : Setup npm
38+ run : npm i -g npm
39+
40+ - name : Setup PHP
41+ uses : shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d
42+ with :
43+ php-version : ' 8.2'
44+ extensions : mbstring, intl, mysql, gd
45+ ini-values : post_max_size=256M, max_execution_time=180
46+ coverage : xdebug
47+ tools : php-cs-fixer, phpunit
48+
49+ - name : Build nextcloud project
50+ # if: ${{ startsWith( steps.tag.outputs.currenttag , 'v' ) }}
51+ # id: build_release
52+ run : |
53+ # echo "app_id=$APP_ID" >> $GITHUB_OUTPUT
54+ # echo "###### copy certificate"
55+ # mkdir -p ~/.nextcloud/certificates
56+ # echo "$APP_CRT" > ~/.nextcloud/certificates/${APP_ID}.crt
57+ # echo "$APP_KEY" > ~/.nextcloud/certificates/${APP_ID}.key
58+ echo "###### install dependencies"
59+ export DEBIAN_FRONTEND=noninteractive
60+ # sudo apt update -y
61+ # sudo apt install make openssl -y
62+ echo "###### installing nextcloud"
63+ mkdir ~/html
64+ git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b stable29 ~/html/nextcloud
65+ cd ~/html/nextcloud
66+ git submodule update --init
67+ mkdir -p data
68+ # chown -R www-data:www-data config data apps
69+ php occ maintenance:install \
70+ --database mysql \
71+ --database-name nextcloud \
72+ --database-host 127.0.0.1 \
73+ --database-user nextcloud \
74+ --database-pass nextcloud \
75+ --admin-user admin \
76+ --admin-pass admin
77+ php occ maintenance:mode --off
78+ sudo php -S localhost:80 -t ~/html/nextcloud &
79+
80+ - name : Wait for Nextcloud server to be ready
81+ run : |
82+ if ! timeout 5m bash -c '
83+ until curl -s -f http://localhost/status.php | grep '"'"'"installed":true'"'"'; do
84+ echo "[INFO] Waiting for server to be ready..."
85+ sleep 10
86+ done
87+ '; then
88+ echo "[ERROR] Server not ready within 5 minutes."
89+ exit 1
90+ fi
91+
92+
93+ - name : Setup System dependencies for appstore
94+ run : |
95+ sudo apt install -y \
96+ python3-venv \
97+ python3-wheel \
98+ libxslt-dev \
99+ libxml2-dev \
100+ libz-dev \
101+ libpq-dev \
102+ build-essential \
103+ python3-dev \
104+ python3-setuptools \
105+ gettext \
106+ libssl-dev \
107+ libffi-dev \
108+ nodejs \
109+ yarn
110+
111+ - name : Checkout appstore
112+ uses : actions/checkout@v3
113+ with :
114+ repository : nextcloud/appstore
115+ path : appstore
116+
117+ - name : Install Appstore
118+ run : |
119+ cd appstore
120+ python3 -m venv venv
121+ source venv/bin/activate
122+ pip install poetry==1.8.2
123+ make dev-setup
124+ python manage.py runserver &
125+
126+ - name : Check for Appstore
127+ run : |
128+ cd appstore
129+ status=$(curl -o /dev/null -s -w "%{http_code}" http://localhost:8000)
130+ if [ "$status" -eq 200 ]; then
131+ echo "OK"
132+ else
133+ echo "FAILED (status: $status)"
134+ fi
135+
136+ - name : Register and publish apps
137+ run : |
138+ wget https://raw.githubusercontent.com/nextcloud/integration_openproject/${{github.head_ref}}/.github/scripts/self-hosted-app-store.sh
139+ bash ./self-hosted-app-store.sh
140+
141+ - name : Configure Nextcloud for testing
142+ run : |
143+ ls -l
144+ cd ~/html/nextcloud
145+ ls -l
146+ php occ config:system:set appstoreurl --value http://localhost:8000/api/v1
147+ php occ config:system:set allow_local_remote_servers --value true
148+ # php occ app:enable integration_openproject
149+
150+ # - name: Setup Debug Session
151+ # uses: csexton/debugger-action@master
152+
153+ - name : Configure Nextcloud for testing
154+ run : |
155+ ls -l
156+ cd ~/html/nextcloud
157+ ls -l
158+ php occ app:enable integration_openproject
0 commit comments