1- name : S3 primary storage
1+ name : Object storage S3
22on :
33 pull_request :
4- push :
5- branches :
6- - master
7- - stable*
4+ schedule :
5+ - cron : " 15 2 * * *"
6+
7+ concurrency :
8+ group : object-storage-s3-${{ github.head_ref || github.run_id }}
9+ cancel-in-progress : true
810
911jobs :
12+ changes :
13+ runs-on : ubuntu-latest-low
14+
15+ outputs :
16+ src : ${{ steps.changes.outputs.src}}
17+
18+ steps :
19+ - uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
20+ id : changes
21+ continue-on-error : true
22+ with :
23+ filters : |
24+ src:
25+ - '.github/workflows/**'
26+ - '3rdparty/**'
27+ - '**/appinfo/**'
28+ - '**/lib/**'
29+ - '**/templates/**'
30+ - '**/tests/**'
31+ - 'vendor/**'
32+ - 'vendor-bin/**'
33+ - '.php-cs-fixer.dist.php'
34+ - 'composer.json'
35+ - 'composer.lock'
36+ - '**.php'
37+
1038 s3-primary-tests-minio :
11- runs-on : ubuntu-20.04
39+ runs-on : ubuntu-22.04
40+ needs : changes
1241
13- if : ${{ github.repository_owner != 'nextcloud-gmbh' }}
42+ if : ${{ github.repository_owner != 'nextcloud-gmbh' && needs.changes.outputs.src != 'false' }}
1443
1544 strategy :
16- # do not stop on another job's failure
17- fail-fast : false
1845 matrix :
19- php-versions : ['8.0']
20- key : ['objectstore', 'objectstore_multibucket']
46+ php-versions : ["8.0"]
47+ include :
48+ - php-versions : " 8.0"
49+ coverage : true
2150
22- name : php${{ matrix.php-versions }}-${{ matrix.key }}-minio
51+ name : php${{ matrix.php-versions }}-s3
2352
2453 services :
54+ cache :
55+ image : ghcr.io/nextcloud/continuous-integration-redis:latest
56+ ports :
57+ - 6379:6379/tcp
58+ options : --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
59+
2560 minio :
61+ image : bitnami/minio@sha256:50cec18ac4184af4671a78aedd5554942c8ae105d51a465fa82037949046da01 # v2025.4.22
2662 env :
27- MINIO_ACCESS_KEY : minio
28- MINIO_SECRET_KEY : minio123
29- image : bitnami/minio:2021.12.29
63+ MINIO_ROOT_USER : nextcloud
64+ MINIO_ROOT_PASSWORD : bWluaW8tc2VjcmV0LWtleS1uZXh0Y2xvdWQ=
65+ MINIO_DEFAULT_BUCKETS : nextcloud
3066 ports :
3167 - " 9000:9000"
3268
3369 steps :
3470 - name : Checkout server
35- uses : actions/checkout@v3
71+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3672 with :
3773 submodules : true
3874
3975 - name : Set up php ${{ matrix.php-versions }}
40- uses : shivammathur/setup-php@v2
76+ uses : shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
4177 with :
4278 php-version : ${{ matrix.php-versions }}
4379 tools : phpunit:9
44- extensions : mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd
80+ # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
81+ extensions : bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, redis, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
82+ coverage : ${{ matrix.coverage && 'xdebug' || 'none' }}
83+ ini-file : development
4584 env :
4685 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4786
4887 - name : Set up Nextcloud
88+ env :
89+ OBJECT_STORE : s3
90+ OBJECT_STORE_KEY : nextcloud
91+ OBJECT_STORE_SECRET : bWluaW8tc2VjcmV0LWtleS1uZXh0Y2xvdWQ=
4992 run : |
50- mkdir data
51- echo '<?php $CONFIG=["${{ matrix.key }}" => ["class" => "OC\Files\ObjectStore\S3", "arguments" => ["bucket" => "nextcloud", "autocreate" => true, "key" => "minio", "secret" => "minio123", "hostname" => "localhost", "port" => 9000, "use_ssl" => false, "use_path_style" => true, "uploadPartSize" => 52428800]]];' > config/config.php
93+ composer install
94+ cp tests/redis.config.php config/
95+ cp tests/preseed-config.php config/config.php
5296 ./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password
53- php -f index .php
97+ php -f tests/enable_all .php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
5498
5599 - name : Wait for S3
56100 run : |
@@ -59,20 +103,31 @@ jobs:
59103
60104 - name : PHPUnit
61105 working-directory : tests
106+ env :
107+ OBJECT_STORE : s3
108+ OBJECT_STORE_KEY : nextcloud
109+ OBJECT_STORE_SECRET : bWluaW8tc2VjcmV0LWtleS1uZXh0Y2xvdWQ=
62110 run : phpunit --configuration phpunit-autotest.xml --group DB,SLOWDB
111+
112+ - name : Upload code coverage
113+ if : ${{ !cancelled() && matrix.coverage }}
114+ uses : codecov/codecov-action@v4
115+ with :
116+ files : ./clover.xml
117+ flags : phpunit-s3
118+
63119 - name : S3 logs
64120 if : always()
65121 run : |
66122 docker ps -a
67- docker logs $(docker ps -aq)
68-
123+ docker ps -aq | while read container ; do IMAGE=$(docker inspect --format='{{.Config.Image}}' $container); echo $IMAGE; docker logs $container; echo "\n\n" ; done
69124
70125 s3-primary-summary :
71- runs-on : ubuntu-latest
72- needs : [s3-primary-tests-minio]
126+ runs-on : ubuntu-latest-low
127+ needs : [changes, s3-primary-tests-minio]
73128
74129 if : always()
75130
76131 steps :
77132 - name : Summary status
78- run : if ${{ needs.s3-primary-tests-minio.result != 'success' }}; then exit 1; fi
133+ run : if ${{ needs.changes.outputs.src != 'false' && needs. s3-primary-tests-minio.result != 'success' }}; then exit 1; fi
0 commit comments