|
1 | | -name: S3 primary storage |
| 1 | +name: Object storage S3 |
2 | 2 | on: |
3 | 3 | 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 |
8 | 10 |
|
9 | 11 | jobs: |
| 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 | +
|
10 | 38 | s3-primary-tests-minio: |
11 | | - runs-on: ubuntu-20.04 |
| 39 | + runs-on: ubuntu-22.04 |
| 40 | + needs: changes |
12 | 41 |
|
13 | | - if: ${{ github.repository_owner != 'nextcloud-gmbh' }} |
| 42 | + if: ${{ github.repository_owner != 'nextcloud-gmbh' && needs.changes.outputs.src != 'false' }} |
14 | 43 |
|
15 | 44 | strategy: |
16 | | - # do not stop on another job's failure |
17 | | - fail-fast: false |
18 | 45 | 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 |
21 | 50 |
|
22 | | - name: php${{ matrix.php-versions }}-${{ matrix.key }}-minio |
| 51 | + name: php${{ matrix.php-versions }}-s3 |
23 | 52 |
|
24 | 53 | 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 | + |
25 | 60 | minio: |
| 61 | + image: bitnami/minio@sha256:50cec18ac4184af4671a78aedd5554942c8ae105d51a465fa82037949046da01 # v2025.4.22 |
26 | 62 | 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 |
30 | 66 | ports: |
31 | 67 | - "9000:9000" |
32 | 68 |
|
33 | 69 | steps: |
34 | 70 | - name: Checkout server |
35 | | - uses: actions/checkout@v3 |
| 71 | + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 |
36 | 72 | with: |
37 | 73 | submodules: true |
38 | 74 |
|
39 | 75 | - name: Set up php ${{ matrix.php-versions }} |
40 | | - uses: shivammathur/setup-php@v2 |
| 76 | + uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1 |
41 | 77 | with: |
42 | 78 | php-version: ${{ matrix.php-versions }} |
43 | 79 | 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 |
45 | 84 | env: |
46 | 85 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
47 | 86 |
|
48 | 87 | - name: Set up Nextcloud |
| 88 | + env: |
| 89 | + OBJECT_STORE: s3 |
| 90 | + OBJECT_STORE_KEY: nextcloud |
| 91 | + OBJECT_STORE_SECRET: bWluaW8tc2VjcmV0LWtleS1uZXh0Y2xvdWQ= |
49 | 92 | 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 |
52 | 96 | ./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 |
54 | 98 |
|
55 | 99 | - name: Wait for S3 |
56 | 100 | run: | |
57 | 101 | sleep 10 |
58 | 102 | curl -f -m 1 --retry-connrefused --retry 10 --retry-delay 10 http://localhost:9000/minio/health/ready |
59 | 103 |
|
60 | 104 | - name: PHPUnit |
61 | | - working-directory: tests |
| 105 | + env: |
| 106 | + OBJECT_STORE: s3 |
| 107 | + OBJECT_STORE_KEY: nextcloud |
| 108 | + OBJECT_STORE_SECRET: bWluaW8tc2VjcmV0LWtleS1uZXh0Y2xvdWQ= |
62 | 109 | run: phpunit --configuration phpunit-autotest.xml --group DB,SLOWDB |
| 110 | + |
| 111 | + - name: Upload code coverage |
| 112 | + if: ${{ !cancelled() && matrix.coverage }} |
| 113 | + uses: codecov/codecov-action@v4 |
| 114 | + with: |
| 115 | + files: ./clover.xml |
| 116 | + flags: phpunit-s3 |
| 117 | + |
63 | 118 | - name: S3 logs |
64 | 119 | if: always() |
65 | 120 | run: | |
66 | 121 | docker ps -a |
67 | | - docker logs $(docker ps -aq) |
68 | | -
|
| 122 | + docker ps -aq | while read container ; do IMAGE=$(docker inspect --format='{{.Config.Image}}' $container); echo $IMAGE; docker logs $container; echo "\n\n" ; done |
69 | 123 |
|
70 | 124 | s3-primary-summary: |
71 | | - runs-on: ubuntu-latest |
72 | | - needs: [s3-primary-tests-minio] |
| 125 | + runs-on: ubuntu-latest-low |
| 126 | + needs: [changes, s3-primary-tests-minio] |
73 | 127 |
|
74 | 128 | if: always() |
75 | 129 |
|
76 | 130 | steps: |
77 | 131 | - name: Summary status |
78 | | - run: if ${{ needs.s3-primary-tests-minio.result != 'success' }}; then exit 1; fi |
| 132 | + run: if ${{ needs.changes.outputs.src != 'false' && needs.s3-primary-tests-minio.result != 'success' }}; then exit 1; fi |
0 commit comments