Skip to content

Commit c0e782f

Browse files
committed
ci: add matrix
Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
1 parent 183de4e commit c0e782f

1 file changed

Lines changed: 51 additions & 33 deletions

File tree

.github/workflows/appstore.yml

Lines changed: 51 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,56 @@
99

1010
name: Upgrade Testing
1111

12-
on: [pull_request]
12+
on:
13+
pull_request:
14+
# workflow_call:
15+
# inputs:
16+
# nextcloud_versions:
17+
# required: false
18+
# type: string
19+
# default: "31 32"
20+
# php_versions:
21+
# required: false
22+
# type: string
23+
# default: "8.2 8.3"
24+
# previous_app_version:
25+
# required: false
26+
# type: string
27+
# default: "2.9.2"
28+
# upgrade_app_version:
29+
# required: false
30+
# type: string
31+
# default: "2.10.0"
1332

1433
jobs:
15-
build:
34+
create-matrix:
35+
runs-on: ubuntu-22.04
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
39+
40+
- name: Create matrix
41+
id: create-matrix
42+
env:
43+
NEXTCLOUD_VERSIONS: ${{ inputs.nextcloud_versions }}
44+
PHP_VERSIONS: ${{ inputs.php_versions }}
45+
run: |
46+
MATRIX=$(./.github/scripts/generate-matrix.sh)
47+
echo "matrix={\"include\": [$MATRIX]}" >> $GITHUB_OUTPUT
48+
outputs:
49+
matrix: ${{ steps.create-matrix.outputs.matrix }}
50+
51+
upgrade-test:
52+
name: Upgrade Testing
53+
needs: create-matrix
54+
if: ${{ success() }}
55+
strategy:
56+
matrix: ${{ fromJson(needs.create-matrix.outputs.matrix) }}
1657
runs-on: ubuntu-latest
58+
1759
env:
1860
DJANGO_SETTINGS_MODULE: nextcloudappstore.settings.development
1961
services:
20-
2162
database-mysql:
2263
image: ghcr.io/nextcloud/continuous-integration-mariadb-10.5:latest
2364
env:
@@ -34,13 +75,13 @@ jobs:
3475
with:
3576
path: integration_openproject
3677
fetch-tags: true
37-
ref: v2.10.0
78+
ref: v${{ inputs.upgrade_app_version }}
3879

3980
- name: Checkout
4081
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
4182
with:
4283
repository: nextcloud/activity
43-
ref: stable29
84+
ref: stable${{ matrix.nextcloud_version }}
4485
path: activity
4586

4687
- name: Setup NodeJS
@@ -54,7 +95,7 @@ jobs:
5495
- name: Setup PHP
5596
uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d
5697
with:
57-
php-version: '8.2'
98+
php-version: ${{ matrix.php_version }}
5899
extensions: mbstring, intl, mysql, gd
59100
ini-values: post_max_size=256M, max_execution_time=180
60101
coverage: xdebug
@@ -65,7 +106,7 @@ jobs:
65106
export DEBIAN_FRONTEND=noninteractive
66107
echo "###### installing nextcloud"
67108
mkdir ~/html
68-
git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b stable29 ~/html/nextcloud
109+
git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b stable${{ matrix.nextcloud_version }} ~/html/nextcloud
69110
cd ~/html/nextcloud
70111
git submodule update --init
71112
mkdir -p data
@@ -140,23 +181,12 @@ jobs:
140181
- name: Register and publish integration_openproject apps
141182
env:
142183
APP_ID: integration_openproject
143-
APP_VERSION: 2.9.2
184+
APP_VERSION: ${{ inputs.previous_app_version }}
144185
SIGNATURE: signature1
145186
run: |
146187
wget https://raw.githubusercontent.com/nextcloud/integration_openproject/${{github.head_ref}}/.github/scripts/self-hosted-app-store.sh
147188
bash ./self-hosted-app-store.sh
148189
149-
# - name: Register and publish groupfolders apps
150-
# env:
151-
# APP_ID: groupfolders
152-
# APP_VERSION: 17.0.15
153-
# SIGNATURE: signature1
154-
# run: |
155-
# bash ./self-hosted-app-store.sh
156-
157-
# - name: Setup Debug Session
158-
# uses: csexton/debugger-action@master
159-
160190
- name: Enable other apps from official app store
161191
run: |
162192
cp -R activity ~/html/nextcloud/apps
@@ -182,7 +212,7 @@ jobs:
182212
- name: Register and publish next release of the app
183213
env:
184214
APP_ID: integration_openproject
185-
APP_VERSION: 2.10.0
215+
APP_VERSION: ${{ inputs.upgrade_app_version }}
186216
SIGNATURE: signature2
187217
run: |
188218
bash ./self-hosted-app-store.sh
@@ -202,16 +232,4 @@ jobs:
202232
# build apps
203233
make
204234
# Run API tests
205-
make api-test
206-
# make api-test FEATURE_PATH=tests/acceptance/features/api/capabilities.feature
207-
208-
# - name: Setup Debug Session
209-
# uses: csexton/debugger-action@master
210-
211-
# - name: Configure Nextcloud for testing
212-
# run: |
213-
# ls -l
214-
215-
# cd ~/html/nextcloud
216-
# ls -l
217-
# php occ app:install integration_openproject
235+
make api-test

0 commit comments

Comments
 (0)