Skip to content

[pre-commit.ci] pre-commit autoupdate (#315) #1366

[pre-commit.ci] pre-commit autoupdate (#315)

[pre-commit.ci] pre-commit autoupdate (#315) #1366

name: Analysis & Coverage
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
concurrency:
group: ana_cov-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
NEXTCLOUD_URL: "http://localhost:8080"
APP_ID: "nc_py_api"
APP_VERSION: "1.0.0"
APP_SECRET: "tC6vkwPhcppjMykD1r0n9NlI95uJMBYjs5blpIcA1PAdoPDmc5qoAjaBAkyocZ6E"
APP_PORT: 9009
NC_AUTH_USER: "admin"
NC_AUTH_PASS: "adminpassword"
NEXTCLOUD_VERSION: 28.0.7
NEXTCLOUD_BRANCH: stable28
jobs:
analysis:
runs-on: macos-14
name: Analysis
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install from source
run: python3 -m pip install ".[dev]"
- name: Run Analysis
run: python3 -m pylint "nc_py_api/"
tests-maria:
needs: [analysis]
runs-on: ubuntu-22.04
name: 28.X.X • 🐘8.1 • 🐍3.10 • Maria
timeout-minutes: 60
services:
mariadb:
image: mariadb:11.5
env:
MARIADB_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: nextcloud
options: >-
--health-cmd mysqladmin ping
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 3306:3306
steps:
- name: Set up php
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring, fileinfo, intl, pdo_mysql, zip, gd
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: cache-nextcloud
id: nextcloud_setup
uses: actions/cache@v4
with:
path: nextcloud-${{ env.NEXTCLOUD_VERSION }}.tar.bz2
key: ${{ env.NEXTCLOUD_VERSION }}
- name: Download Nextcloud
if: steps.nextcloud_setup.outputs.cache-hit != 'true'
run: wget -q https://download.nextcloud.com/server/releases/nextcloud-${{ env.NEXTCLOUD_VERSION }}.tar.bz2
- name: Set up Nextcloud
run: |
tar -xjf nextcloud-${{ env.NEXTCLOUD_VERSION }}.tar.bz2 --strip-components 1
mkdir data
php occ maintenance:install --verbose --database=mysql --database-name=nextcloud \
--database-host=127.0.0.1 --database-user=root --database-pass=rootpassword \
--admin-user admin --admin-pass ${{ env.NC_AUTH_PASS }}
php occ config:system:set loglevel --value=1 --type=integer
php occ config:system:set debug --value=true --type=boolean
PHP_CLI_SERVER_WORKERS=2 php -S localhost:8080 &
- name: Checkout NcPyApi
uses: actions/checkout@v4
with:
path: nc_py_api
- name: Install NcPyApi
working-directory: nc_py_api
run: python3 -m pip -v install ".[dev]"
- name: Checkout AppAPI
uses: actions/checkout@v4
with:
path: apps/app_api
repository: nextcloud/app_api
ref: stable29
- name: Install AppAPI
run: |
php occ app:enable app_api
cd nc_py_api
coverage run --data-file=.coverage.ci_install tests/_install.py &
echo $! > /tmp/_install.pid
python3 tests/_install_wait.py http://127.0.0.1:$APP_PORT/heartbeat "\"status\":\"ok\"" 15 0.5
python3 tests/_app_security_checks.py http://127.0.0.1:$APP_PORT
cd ..
sh nc_py_api/scripts/ci_register.sh "$APP_ID" "$APP_VERSION" "$APP_SECRET" "localhost" "$APP_PORT"
kill -15 $(cat /tmp/_install.pid)
timeout 3m tail --pid=$(cat /tmp/_install.pid) -f /dev/null
- name: Checkout Talk
uses: actions/checkout@v4
with:
path: apps/spreed
repository: nextcloud/spreed
ref: ${{ env.NEXTCLOUD_BRANCH }}
- name: Install Talk
working-directory: apps/spreed
run: make dev-setup
- name: Enable Talk
run: php occ app:enable spreed
- name: Generate coverage report (1)
working-directory: nc_py_api
run: |
coverage run --data-file=.coverage.talk_bot tests/_talk_bot.py &
echo $! > /tmp/_talk_bot.pid
coverage run --data-file=.coverage.ci -m pytest
kill -15 $(cat /tmp/_talk_bot.pid)
timeout 3m tail --pid=$(cat /tmp/_talk_bot.pid) -f /dev/null
coverage run --data-file=.coverage.at_the_end -m pytest tests/_tests_at_the_end.py
- name: Uninstall NcPyApi
run: |
php occ app_api:app:unregister "$APP_ID" --silent --force
php occ app_api:daemon:unregister manual_install
- name: Generate coverage report (2)
working-directory: nc_py_api
run: |
coverage run --data-file=.coverage.ci_install_models tests/_install_init_handler_models.py &
echo $! > /tmp/_install_models.pid
python3 tests/_install_wait.py http://127.0.0.1:$APP_PORT/heartbeat "\"status\":\"ok\"" 15 0.5
cd ..
sh nc_py_api/scripts/ci_register.sh "$APP_ID" "$APP_VERSION" "$APP_SECRET" "localhost" "$APP_PORT"
kill -15 $(cat /tmp/_install_models.pid)
timeout 3m tail --pid=$(cat /tmp/_install_models.pid) -f /dev/null
cd nc_py_api
coverage combine && coverage xml -o coverage_maria_${{ env.NEXTCLOUD_VERSION }}_3.10_8.1.xml
- name: Upload Codecov to artifacts
uses: actions/upload-artifact@v4
with:
name: coverage_maria_${{ env.NEXTCLOUD_VERSION }}_3.10_8.1.xml
path: nc_py_api/coverage_maria_${{ env.NEXTCLOUD_VERSION }}_3.10_8.1.xml
if-no-files-found: error
- name: Upload NC logs
if: always()
uses: actions/upload-artifact@v4
with:
name: nc_log_maria_${{ env.NEXTCLOUD_VERSION }}_3.10_8.1
path: data/nextcloud.log
if-no-files-found: warn
tests-pgsql:
needs: [analysis]
runs-on: ubuntu-22.04
name: 28.X.X • 🐘8.2 • 🐍3.11 • PgSQL
env:
NC_dbname: nextcloud_abz
DATABASE_PGSQL: 1
timeout-minutes: 60
services:
postgres:
image: postgres:17
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: rootpassword
POSTGRES_DB: ${{ env.NC_dbname }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Set up php 8.2
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: mbstring, fileinfo, intl, pdo_mysql, zip, gd
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: cache-nextcloud
id: nextcloud_setup
uses: actions/cache@v4
with:
path: nextcloud-${{ env.NEXTCLOUD_VERSION }}.tar.bz2
key: ${{ env.NEXTCLOUD_VERSION }}
- name: Download Nextcloud
if: steps.nextcloud_setup.outputs.cache-hit != 'true'
run: wget -q https://download.nextcloud.com/server/releases/nextcloud-${{ env.NEXTCLOUD_VERSION }}.tar.bz2
- name: Set up Nextcloud
run: |
tar -xjf nextcloud-${{ env.NEXTCLOUD_VERSION }}.tar.bz2 --strip-components 1
mkdir data
php occ maintenance:install --verbose --database=pgsql --database-name=${{ env.NC_dbname }} \
--database-host=127.0.0.1 --database-user=root --database-pass=rootpassword \
--admin-user admin --admin-pass ${{ env.NC_AUTH_PASS }}
php occ config:system:set loglevel --value=1
php occ config:system:set debug --value=true --type=boolean
PHP_CLI_SERVER_WORKERS=2 php -S localhost:8080 &
- name: Checkout NcPyApi
uses: actions/checkout@v4
with:
path: nc_py_api
- name: Install NcPyApi
working-directory: nc_py_api
run: python3 -m pip -v install ".[dev]"
- name: Checkout AppAPI
uses: actions/checkout@v4
with:
path: apps/app_api
repository: nextcloud/app_api
ref: stable29
- name: Install AppAPI
run: |
php occ app:enable app_api
cd nc_py_api
coverage run --data-file=.coverage.ci_install tests/_install.py &
echo $! > /tmp/_install.pid
python3 tests/_install_wait.py http://127.0.0.1:$APP_PORT/heartbeat "\"status\":\"ok\"" 15 0.5
python3 tests/_app_security_checks.py http://127.0.0.1:$APP_PORT
cd ..
sh nc_py_api/scripts/ci_register.sh "$APP_ID" "$APP_VERSION" "$APP_SECRET" "localhost" "$APP_PORT"
kill -15 $(cat /tmp/_install.pid)
timeout 3m tail --pid=$(cat /tmp/_install.pid) -f /dev/null
- name: Checkout Talk
uses: actions/checkout@v4
with:
path: apps/spreed
repository: nextcloud/spreed
ref: ${{ env.NEXTCLOUD_BRANCH }}
- name: Install Talk
working-directory: apps/spreed
run: make dev-setup
- name: Enable Talk
run: php occ app:enable spreed
- name: Generate coverage report (1)
working-directory: nc_py_api
run: |
coverage run --data-file=.coverage.talk_bot tests/_talk_bot.py &
echo $! > /tmp/_talk_bot.pid
coverage run --data-file=.coverage.ci -m pytest
kill -15 $(cat /tmp/_talk_bot.pid)
timeout 3m tail --pid=$(cat /tmp/_talk_bot.pid) -f /dev/null
coverage run --data-file=.coverage.at_the_end -m pytest tests/_tests_at_the_end.py
- name: Uninstall NcPyApi
run: |
php occ app_api:app:unregister "$APP_ID" --silent --force
php occ app_api:daemon:unregister manual_install
- name: Generate coverage report (2)
working-directory: nc_py_api
run: |
coverage run --data-file=.coverage.ci_install_models tests/_install_init_handler_models.py &
echo $! > /tmp/_install_models.pid
python3 tests/_install_wait.py http://127.0.0.1:$APP_PORT/heartbeat "\"status\":\"ok\"" 15 0.5
cd ..
sh nc_py_api/scripts/ci_register.sh "$APP_ID" "$APP_VERSION" "$APP_SECRET" "localhost" "$APP_PORT"
kill -15 $(cat /tmp/_install_models.pid)
timeout 3m tail --pid=$(cat /tmp/_install_models.pid) -f /dev/null
cd nc_py_api
coverage combine && coverage xml -o coverage_pgsql_${{ env.NEXTCLOUD_VERSION }}_3.11_8.2.xml
- name: Upload Codecov to artifacts
uses: actions/upload-artifact@v4
with:
name: coverage_pgsql_${{ env.NEXTCLOUD_VERSION }}_3.11_8.2.xml
path: nc_py_api/coverage_pgsql_${{ env.NEXTCLOUD_VERSION }}_3.11_8.2.xml
if-no-files-found: error
- name: Upload NC logs
if: always()
uses: actions/upload-artifact@v4
with:
name: nc_log_pgsql_${{ env.NEXTCLOUD_VERSION }}_3.11_8.2
path: data/nextcloud.log
if-no-files-found: warn
tests-oci:
needs: [analysis]
runs-on: ubuntu-22.04
name: stable28 • 🐘8.1 • 🐍3.11 • OCI
timeout-minutes: 60
services:
oracle:
image: ghcr.io/gvenzl/oracle-xe:11
env:
ORACLE_RANDOM_PASSWORD: true
APP_USER: useroracle
APP_USER_PASSWORD: userpassword
options: >-
--health-cmd healthcheck.sh
--health-interval 10s
--health-timeout 5s
--health-retries 10
ports:
- 1521:1521/tcp
steps:
- name: Set up php
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, \
posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, oci8
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Checkout server
uses: actions/checkout@v4
with:
submodules: true
repository: nextcloud/server
ref: ${{ env.NEXTCLOUD_BRANCH }}
- name: Checkout Notifications
uses: actions/checkout@v4
with:
repository: nextcloud/notifications
ref: ${{ env.NEXTCLOUD_BRANCH }}
path: apps/notifications
- name: Set up Nextcloud
run: |
mkdir data
php occ maintenance:install --verbose --database=oci --database-name=XE \
--database-host=127.0.0.1 --database-port=1521 --database-user=useroracle --database-pass=userpassword \
--admin-user admin --admin-pass ${{ env.NC_AUTH_PASS }}
php occ config:system:set loglevel --value=1 --type=integer
php occ config:system:set debug --value=true --type=boolean
PHP_CLI_SERVER_WORKERS=2 php -S localhost:8080 &
- name: Checkout NcPyApi
uses: actions/checkout@v4
with:
path: nc_py_api
- name: Install NcPyApi
working-directory: nc_py_api
run: python3 -m pip -v install ".[app,dev-min]"
- name: Checkout AppAPI
uses: actions/checkout@v4
with:
path: apps/app_api
repository: nextcloud/app_api
ref: stable29
- name: Install AppAPI
run: |
php occ app:enable app_api
cd nc_py_api
coverage run --data-file=.coverage.ci_install tests/_install.py &
echo $! > /tmp/_install.pid
python3 tests/_install_wait.py http://127.0.0.1:$APP_PORT/heartbeat "\"status\":\"ok\"" 15 0.5
python3 tests/_app_security_checks.py http://127.0.0.1:$APP_PORT
cd ..
sh nc_py_api/scripts/ci_register.sh "$APP_ID" "$APP_VERSION" "$APP_SECRET" "localhost" "$APP_PORT"
kill -15 $(cat /tmp/_install.pid)
timeout 3m tail --pid=$(cat /tmp/_install.pid) -f /dev/null
- name: Generate coverage report
working-directory: nc_py_api
run: |
coverage run --data-file=.coverage.ci -m pytest
coverage run --data-file=.coverage.at_the_end -m pytest tests/_tests_at_the_end.py
coverage combine && coverage xml -o coverage_oci_${{ env.NEXTCLOUD_BRANCH }}_3.11_8.1.xml
env:
SKIP_NC_CLIENT_TESTS: 1
- name: Upload Codecov to artifacts
uses: actions/upload-artifact@v4
with:
name: coverage_oci_${{ env.NEXTCLOUD_BRANCH }}_3.11_8.1.xml
path: nc_py_api/coverage_oci_${{ env.NEXTCLOUD_BRANCH }}_3.11_8.1.xml
if-no-files-found: error
- name: Upload NC logs
if: always()
uses: actions/upload-artifact@v4
with:
name: nc_log_oci_${{ env.NEXTCLOUD_BRANCH }}_3.11_8.1
path: data/nextcloud.log
if-no-files-found: warn
tests-latest-maria:
needs: [analysis]
runs-on: ubuntu-22.04
name: ${{ matrix.nextcloud }} • 🐘8.2 • 🐍3.10 • Maria
strategy:
fail-fast: false
matrix:
nextcloud: [ 'stable28', 'stable29', 'stable30' ]
timeout-minutes: 60
services:
mariadb:
image: mariadb:11.5
env:
MARIADB_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: nextcloud
options: >-
--health-cmd mysqladmin ping
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 3306:3306
steps:
- name: Set up php
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: mbstring, fileinfo, intl, pdo_mysql, zip, gd, curl
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Checkout server
uses: actions/checkout@v4
with:
submodules: true
repository: nextcloud/server
ref: ${{ matrix.nextcloud }}
- name: Checkout Notifications
uses: actions/checkout@v4
with:
repository: nextcloud/notifications
ref: ${{ matrix.nextcloud }}
path: apps/notifications
- name: Checkout Notes
uses: actions/checkout@v4
with:
repository: nextcloud/notes
ref: "main"
path: apps/notes
- name: Checkout Files Locking
uses: actions/checkout@v4
with:
repository: nextcloud/files_lock
ref: ${{ matrix.nextcloud }}
path: apps/files_lock
- name: Set up & run Nextcloud
env:
DB_PORT: 4444
run: |
mkdir data
./occ maintenance:install --verbose --database=mysql --database-name=nextcloud \
--database-host=127.0.0.1 --database-user=root --database-pass=rootpassword \
--admin-user admin --admin-pass ${{ env.NC_AUTH_PASS }}
./occ config:system:set loglevel --value=0 --type=integer
./occ config:system:set debug --value=true --type=boolean
./occ app:enable notifications
PHP_CLI_SERVER_WORKERS=2 php -S localhost:8080 &
- name: Enable Files Locking
run: ./occ app:enable files_lock
- name: Enable Notes
run: ./occ app:enable notes
- name: Checkout NcPyApi
uses: actions/checkout@v4
with:
path: nc_py_api
- name: Install NcPyApi
working-directory: nc_py_api
run: python3 -m pip -v install ".[dev]"
- name: Checkout AppAPI
if: ${{ matrix.nextcloud != 'stable30' }}
uses: actions/checkout@v4
with:
path: apps/app_api
repository: nextcloud/app_api
ref: stable29
- name: Checkout AppAPI
if: ${{ matrix.nextcloud == 'stable30' }}
uses: actions/checkout@v4
with:
path: apps/app_api
repository: nextcloud/app_api
ref: stable30
- name: Install AppAPI
run: |
php occ app:enable app_api
cd nc_py_api
coverage run --data-file=.coverage.ci_install tests/_install.py &
echo $! > /tmp/_install.pid
python3 tests/_install_wait.py http://127.0.0.1:$APP_PORT/heartbeat "\"status\":\"ok\"" 15 0.5
python3 tests/_app_security_checks.py http://127.0.0.1:$APP_PORT
cd ..
sh nc_py_api/scripts/ci_register.sh "$APP_ID" "$APP_VERSION" "$APP_SECRET" "localhost" "$APP_PORT"
kill -15 $(cat /tmp/_install.pid)
timeout 3m tail --pid=$(cat /tmp/_install.pid) -f /dev/null
- name: Checkout Talk
uses: actions/checkout@v4
with:
path: apps/spreed
repository: nextcloud/spreed
ref: ${{ matrix.nextcloud }}
- name: Install Talk
working-directory: apps/spreed
run: make dev-setup
- name: Enable Talk
run: php occ app:enable spreed
- name: Generate coverage report (1)
working-directory: nc_py_api
run: |
coverage run --data-file=.coverage.talk_bot tests/_talk_bot_async.py &
echo $! > /tmp/_talk_bot.pid
coverage run --data-file=.coverage.ci -m pytest
kill -15 $(cat /tmp/_talk_bot.pid)
timeout 3m tail --pid=$(cat /tmp/_talk_bot.pid) -f /dev/null
coverage run --data-file=.coverage.at_the_end -m pytest tests/_tests_at_the_end.py
- name: Uninstall NcPyApi
run: |
php occ app_api:app:unregister "$APP_ID" --silent --force
php occ app_api:daemon:unregister manual_install
- name: Generate coverage report (2)
working-directory: nc_py_api
run: |
coverage run --data-file=.coverage.ci_install_models tests/_install_init_handler_models.py &
echo $! > /tmp/_install_models.pid
python3 tests/_install_wait.py http://127.0.0.1:$APP_PORT/heartbeat "\"status\":\"ok\"" 15 0.5
cd ..
sh nc_py_api/scripts/ci_register.sh "$APP_ID" "$APP_VERSION" "$APP_SECRET" "localhost" "$APP_PORT"
kill -15 $(cat /tmp/_install_models.pid)
timeout 3m tail --pid=$(cat /tmp/_install_models.pid) -f /dev/null
cd nc_py_api
coverage combine && coverage xml -o coverage_maria_${{ matrix.nextcloud }}.xml
- name: Upload Codecov to artifacts
uses: actions/upload-artifact@v4
with:
name: coverage_maria_${{ matrix.nextcloud }}.xml
path: nc_py_api/coverage_maria_${{ matrix.nextcloud }}.xml
if-no-files-found: error
- name: Upload NC logs
if: always()
uses: actions/upload-artifact@v4
with:
name: nc_log_maria_${{ matrix.nextcloud }}
path: data/nextcloud.log
if-no-files-found: warn
test-latest-pgsql:
needs: [analysis]
runs-on: ubuntu-22.04
name: ${{ matrix.nextcloud }} • 🐘8.2 • 🐍3.11 • PgSQL
strategy:
fail-fast: false
matrix:
nextcloud: [ 'stable28', 'stable29', 'stable30' ]
env:
NC_dbname: nextcloud_abz
DATABASE_PGSQL: 1
timeout-minutes: 60
services:
postgres:
image: postgres:17
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: rootpassword
POSTGRES_DB: ${{ env.NC_dbname }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Set up php
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: mbstring, fileinfo, intl, pdo_mysql, zip, gd
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Checkout server
uses: actions/checkout@v4
with:
submodules: true
repository: nextcloud/server
ref: ${{ matrix.nextcloud }}
- name: Checkout Notifications
uses: actions/checkout@v4
with:
repository: nextcloud/notifications
ref: ${{ matrix.nextcloud }}
path: apps/notifications
- name: Checkout Activity
uses: actions/checkout@v4
with:
repository: nextcloud/activity
ref: ${{ matrix.nextcloud }}
path: apps/activity
- name: Set up & run Nextcloud
env:
DB_PORT: 4444
run: |
mkdir data
./occ maintenance:install --verbose --database=pgsql --database-name=${{ env.NC_dbname }} \
--database-host=127.0.0.1 --database-user=root --database-pass=rootpassword \
--admin-user admin --admin-pass ${{ env.NC_AUTH_PASS }}
./occ config:system:set loglevel --value=0 --type=integer
./occ config:system:set debug --value=true --type=boolean
./occ app:enable notifications
./occ app:enable activity
PHP_CLI_SERVER_WORKERS=2 php -S localhost:8080 &
- name: Checkout NcPyApi
uses: actions/checkout@v4
with:
path: nc_py_api
- name: Install NcPyApi
working-directory: nc_py_api
run: python3 -m pip -v install ".[dev]"
- name: Checkout AppAPI
if: ${{ matrix.nextcloud != 'stable30' }}
uses: actions/checkout@v4
with:
path: apps/app_api
repository: nextcloud/app_api
ref: stable29
- name: Checkout AppAPI
if: ${{ matrix.nextcloud == 'stable30' }}
uses: actions/checkout@v4
with:
path: apps/app_api
repository: nextcloud/app_api
ref: stable30
- name: Install AppAPI
run: |
php occ app:enable app_api
cd nc_py_api
coverage run --data-file=.coverage.ci_install tests/_install_async.py &
echo $! > /tmp/_install.pid
python3 tests/_install_wait.py http://127.0.0.1:$APP_PORT/heartbeat "\"status\":\"ok\"" 15 0.5
python3 tests/_app_security_checks.py http://127.0.0.1:$APP_PORT
cd ..
sh nc_py_api/scripts/ci_register.sh "$APP_ID" "$APP_VERSION" "$APP_SECRET" "localhost" "$APP_PORT"
kill -15 $(cat /tmp/_install.pid)
timeout 3m tail --pid=$(cat /tmp/_install.pid) -f /dev/null
- name: Checkout Talk
uses: actions/checkout@v4
with:
path: apps/spreed
repository: nextcloud/spreed
ref: ${{ matrix.nextcloud }}
- name: Install Talk
working-directory: apps/spreed
run: |
make dev-setup
- name: Enable Talk
run: php occ app:enable spreed
- name: Generate coverage report (1)
working-directory: nc_py_api
run: |
coverage run --data-file=.coverage.talk_bot tests/_talk_bot_async.py &
echo $! > /tmp/_talk_bot.pid
coverage run --data-file=.coverage.ci -m pytest
kill -15 $(cat /tmp/_talk_bot.pid)
timeout 3m tail --pid=$(cat /tmp/_talk_bot.pid) -f /dev/null
coverage run --data-file=.coverage.at_the_end -m pytest tests/_tests_at_the_end.py
env:
NPA_TIMEOUT: None
NPA_TIMEOUT_DAV: None
NPA_NC_CERT: False
- name: Uninstall NcPyApi
run: |
php occ app_api:app:unregister "$APP_ID" --silent --force
php occ app_api:daemon:unregister manual_install
- name: Generate coverage report (2)
working-directory: nc_py_api
run: |
coverage run --data-file=.coverage.ci_install_models tests/_install_init_handler_models.py &
echo $! > /tmp/_install_models.pid
python3 tests/_install_wait.py http://127.0.0.1:$APP_PORT/heartbeat "\"status\":\"ok\"" 15 0.5
cd ..
sh nc_py_api/scripts/ci_register.sh "$APP_ID" "$APP_VERSION" "$APP_SECRET" "localhost" "$APP_PORT"
kill -15 $(cat /tmp/_install_models.pid)
timeout 3m tail --pid=$(cat /tmp/_install_models.pid) -f /dev/null
cd nc_py_api
coverage combine && coverage xml -o coverage_pgsql_${{ matrix.nextcloud }}.xml
- name: Upload Codecov to artifacts
uses: actions/upload-artifact@v4
with:
name: coverage_pgsql_${{ matrix.nextcloud }}.xml
path: nc_py_api/coverage_pgsql_${{ matrix.nextcloud }}.xml
if-no-files-found: error
- name: Upload NC logs
if: always()
uses: actions/upload-artifact@v4
with:
name: nc_log_pgsql_${{ matrix.nextcloud }}
path: data/nextcloud.log
if-no-files-found: warn
tests-client-sqlite:
needs: [analysis]
runs-on: ubuntu-22.04
name: ${{ matrix.nextcloud }} • 🐍3.12 • Client
strategy:
fail-fast: false
matrix:
nextcloud: [ 'stable27', 'stable28', 'stable29', 'stable30', 'master' ]
env:
NEXTCLOUD_URL: "http://localhost:8080/index.php"
timeout-minutes: 60
steps:
- name: Set up php
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd, curl
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Checkout server
uses: actions/checkout@v4
with:
submodules: true
repository: nextcloud/server
ref: ${{ matrix.nextcloud }}
- name: Checkout Activity
uses: actions/checkout@v4
with:
repository: nextcloud/activity
ref: ${{ matrix.nextcloud }}
path: apps/activity
- name: Checkout Notes
uses: actions/checkout@v4
if: ${{ !startsWith(matrix.nextcloud, 'master') }}
with:
repository: nextcloud/notes
ref: "main"
path: apps/notes
- name: Checkout Files Locking
uses: actions/checkout@v4
if: ${{ !startsWith(matrix.nextcloud, 'stable27') && !startsWith(matrix.nextcloud, 'master') }}
with:
repository: nextcloud/files_lock
ref: ${{ matrix.nextcloud }}
path: apps/files_lock
- name: Set up & run Nextcloud
env:
DB_PORT: 4444
run: |
mkdir data
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 \
--database-port=$DB_PORT --database-user=root --database-pass=rootpassword \
--admin-user admin --admin-pass ${{ env.NC_AUTH_PASS }}
./occ config:system:set loglevel --value=0 --type=integer
./occ config:system:set debug --value=true --type=boolean
./occ app:enable activity
PHP_CLI_SERVER_WORKERS=2 php -S localhost:8080 &
- name: Enable Notes
if: ${{ !startsWith(matrix.nextcloud, 'stable27') && !startsWith(matrix.nextcloud, 'master') }}
run: ./occ app:enable notes
- name: Enable Files Locking
if: ${{ !startsWith(matrix.nextcloud, 'stable27') && !startsWith(matrix.nextcloud, 'master') }}
run: ./occ app:enable files_lock
- name: Checkout NcPyApi
uses: actions/checkout@v4
with:
path: nc_py_api
- name: Install NcPyApi
working-directory: nc_py_api
run: python3 -m pip -v install . pytest pytest-asyncio coverage pillow
- name: Generate coverage report
working-directory: nc_py_api
run: coverage run -m pytest && coverage xml -o coverage_sqlite_${{ matrix.nextcloud }}_client.xml
env:
SKIP_AA_TESTS: 1
NPA_NC_CERT: ''
- name: Upload Codecov to artifacts
uses: actions/upload-artifact@v4
with:
name: coverage_sqlite_${{ matrix.nextcloud }}_client.xml
path: nc_py_api/coverage_sqlite_${{ matrix.nextcloud }}_client.xml
if-no-files-found: error
- name: Upload NC logs
if: always()
uses: actions/upload-artifact@v4
with:
name: nc_log_sqlite_${{ matrix.nextcloud }}
path: data/nextcloud.log
if-no-files-found: warn
tests-upload-coverage:
needs: [tests-maria, tests-pgsql, tests-oci, tests-latest-maria, test-latest-pgsql, tests-client-sqlite]
permissions:
contents: none
runs-on: ubuntu-22.04
name: Upload Coverage
steps:
- uses: actions/checkout@v4
- name: Download Coverage Artifacts
uses: actions/download-artifact@v4
with:
path: coverage
pattern: coverage_*
merge-multiple: true
- name: Upload report to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: coverage
fail_ci_if_error: true
verbose: true
tests-success:
permissions:
contents: none
runs-on: ubuntu-22.04
needs: [tests-upload-coverage]
name: Tests-OK
steps:
- run: echo "Tests passed successfully"