updated NC versions, pinned checkout action to number. #565
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
jobs: | |
analysis: | |
runs-on: macos-13 | |
name: Analysis | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- 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: ${{ matrix.nextcloud }} • 🐘${{ matrix.php-version }} • 🐍${{ matrix.python }} • Maria | |
strategy: | |
fail-fast: false | |
matrix: | |
nextcloud: [ "26.0.7" ] | |
python: [ "3.9" ] | |
php-version: [ "8.1" ] | |
include: | |
- nextcloud: "27.1.1" | |
python: "3.10" | |
php-version: "8.2" | |
services: | |
mariadb: | |
image: mariadb:11.1 | |
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: ${{ matrix.php-version }} | |
extensions: mbstring, fileinfo, intl, pdo_mysql, zip, gd | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Stable26 | |
if: ${{ startsWith(matrix.nextcloud, '26.') }} | |
run: echo "NC_BRANCH_NAME=stable26" >> $GITHUB_ENV | |
- name: Stable27 | |
if: ${{ startsWith(matrix.nextcloud, '27.') }} | |
run: echo "NC_BRANCH_NAME=stable27" >> $GITHUB_ENV | |
- name: cache-nextcloud | |
id: nextcloud_setup | |
uses: actions/cache@v3 | |
with: | |
path: nextcloud-${{ matrix.nextcloud }}.tar.bz2 | |
key: ${{ matrix.nextcloud }} | |
- name: Download Nextcloud | |
if: steps.nextcloud_setup.outputs.cache-hit != 'true' | |
run: wget -q https://download.nextcloud.com/server/releases/nextcloud-${{ matrix.nextcloud }}.tar.bz2 | |
- name: Set up Nextcloud | |
run: | | |
tar -xjf nextcloud-${{ matrix.nextcloud }}.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 -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: cloud-py-api/app_api | |
- name: Patch base.php | |
if: ${{ startsWith(matrix.nextcloud, '26') }} | |
run: patch -p 1 -i apps/app_api/base_php.patch | |
- 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.NC_BRANCH_NAME }} | |
- name: Install Talk | |
working-directory: apps/spreed | |
run: | | |
make dev-setup | |
make build-js | |
- name: Enable Talk | |
# if: ${{ !startsWith(matrix.nextcloud, '27.') }} # for some reason, currently Talk fails with 27.0.2 | |
run: php occ app:enable spreed | |
- name: Generate coverage report | |
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 | |
coverage combine && coverage xml && coverage html | |
- name: HTML coverage to artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage_maria_${{ matrix.nextcloud }}_${{ matrix.python }}_${{ matrix.php-version }} | |
path: nc_py_api/htmlcov | |
if-no-files-found: error | |
- name: Upload report to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
name: coverage_maria_${{ matrix.nextcloud }}_${{ matrix.python }}_${{ matrix.php-version }} | |
file: coverage.xml | |
fail_ci_if_error: true | |
verbose: true | |
working-directory: nc_py_api | |
- name: Upload NC logs | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: nc_log_maria_${{ matrix.nextcloud }}_${{ matrix.python }}_${{ matrix.php-version }} | |
path: data/nextcloud.log | |
if-no-files-found: warn | |
tests-pgsql: | |
needs: [analysis] | |
runs-on: ubuntu-22.04 | |
name: ${{ matrix.nextcloud }} • 🐘${{ matrix.php-version }} • 🐍${{ matrix.python }} • PgSQL | |
strategy: | |
fail-fast: false | |
matrix: | |
nextcloud: [ "26.0.7" ] | |
python: [ "3.11" ] | |
php-version: [ "8.1" ] | |
include: | |
- nextcloud: "27.1.1" | |
python: "3.10" | |
php-version: "8.2" | |
env: | |
NC_dbname: nextcloud_abz | |
services: | |
postgres: | |
image: postgres:16 | |
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 ${{ matrix.php-version }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
extensions: mbstring, fileinfo, intl, pdo_mysql, zip, gd | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Stable26 | |
if: ${{ startsWith(matrix.nextcloud, '26.') }} | |
run: echo "NC_BRANCH_NAME=stable26" >> $GITHUB_ENV | |
- name: Stable27 | |
if: ${{ startsWith(matrix.nextcloud, '27.') }} | |
run: echo "NC_BRANCH_NAME=stable27" >> $GITHUB_ENV | |
- name: cache-nextcloud | |
id: nextcloud_setup | |
uses: actions/cache@v3 | |
with: | |
path: nextcloud-${{ matrix.nextcloud }}.tar.bz2 | |
key: ${{ matrix.nextcloud }} | |
- name: Download Nextcloud | |
if: steps.nextcloud_setup.outputs.cache-hit != 'true' | |
run: wget -q https://download.nextcloud.com/server/releases/nextcloud-${{ matrix.nextcloud }}.tar.bz2 | |
- name: Set up Nextcloud | |
run: | | |
tar -xjf nextcloud-${{ matrix.nextcloud }}.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 -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 | |
if: ${{ !startsWith(matrix.nextcloud, '26.') }} | |
with: | |
path: apps/app_api | |
repository: cloud-py-api/app_api | |
- name: Install AppAPI | |
if: ${{ !startsWith(matrix.nextcloud, '26.') }} | |
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.NC_BRANCH_NAME }} | |
- name: Install Talk | |
working-directory: apps/spreed | |
run: | | |
make dev-setup | |
make build-js | |
- name: Enable Talk | |
if: ${{ !startsWith(matrix.nextcloud, '27.') }} # for some reason, currently Talk fails with 27.0.2 | |
run: php occ app:enable spreed | |
- name: Generate coverage report | |
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 | |
coverage combine && coverage xml && coverage html | |
- name: HTML coverage to artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage_pgsql_${{ matrix.nextcloud }}_${{ matrix.python }}_${{ matrix.php-version }} | |
path: nc_py_api/htmlcov | |
if-no-files-found: error | |
- name: Upload report to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
name: coverage_pgsql_${{ matrix.nextcloud }}_${{ matrix.python }}_${{ matrix.php-version }} | |
file: coverage.xml | |
fail_ci_if_error: true | |
verbose: true | |
working-directory: nc_py_api | |
- name: Upload NC logs | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: nc_log_pgsql_${{ matrix.nextcloud }}_${{ matrix.python }}_${{ matrix.php-version }} | |
path: data/nextcloud.log | |
if-no-files-found: warn | |
tests-oci: | |
needs: [analysis] | |
runs-on: ubuntu-22.04 | |
name: ${{ matrix.nextcloud }} • 🐘${{ matrix.php-version }} • 🐍${{ matrix.python }} • OCI | |
strategy: | |
fail-fast: false | |
matrix: | |
nextcloud: [ "27.1.1" ] | |
python: [ "3.11" ] | |
php-version: [ "8.2" ] | |
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: ${{ matrix.php-version }} | |
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, \ | |
posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, oci8 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: cache-nextcloud | |
id: nextcloud_setup | |
uses: actions/cache@v3 | |
with: | |
path: nextcloud-${{ matrix.nextcloud }}.tar.bz2 | |
key: ${{ matrix.nextcloud }} | |
- name: Download Nextcloud | |
if: steps.nextcloud_setup.outputs.cache-hit != 'true' | |
run: wget -q https://download.nextcloud.com/server/releases/nextcloud-${{ matrix.nextcloud }}.tar.bz2 | |
- name: Set up Nextcloud | |
run: | | |
tar -xjf nextcloud-${{ matrix.nextcloud }}.tar.bz2 --strip-components 1 | |
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 -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: cloud-py-api/app_api | |
- 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 && coverage html | |
env: | |
SKIP_NC_CLIENT_TESTS: 1 | |
- name: HTML coverage to artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage_oci_${{ matrix.nextcloud }}_${{ matrix.python }}_${{ matrix.php-version }} | |
path: nc_py_api/htmlcov | |
if-no-files-found: error | |
- name: Upload report to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
name: coverage_oci_${{ matrix.nextcloud }}_${{ matrix.python }}_${{ matrix.php-version }} | |
file: coverage.xml | |
fail_ci_if_error: true | |
verbose: true | |
working-directory: nc_py_api | |
- name: Upload NC logs | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: nc_log_oci_${{ matrix.nextcloud }}_${{ matrix.python }}_${{ matrix.php-version }} | |
path: data/nextcloud.log | |
if-no-files-found: warn | |
tests-latest-maria-full: | |
needs: [analysis] | |
runs-on: ubuntu-22.04 | |
name: Latest • 🐘8.2 • 🐍3.12 • Maria | |
services: | |
mariadb: | |
image: mariadb:11.1 | |
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@v4 | |
with: | |
python-version: 3.11 | |
- name: Checkout server | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
repository: nextcloud/server | |
ref: "master" | |
- name: Checkout Notifications | |
uses: actions/checkout@v4 | |
with: | |
repository: nextcloud/notifications | |
ref: "master" | |
path: apps/notifications | |
- 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 -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: cloud-py-api/app_api | |
- 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 | |
- name: Install Talk | |
working-directory: apps/spreed | |
run: | | |
make dev-setup | |
make build-js | |
- name: Enable Talk | |
run: php occ app:enable spreed | |
- name: Generate coverage report | |
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 | |
coverage combine && coverage xml && coverage html | |
- name: HTML coverage to artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage_maria_latest | |
path: nc_py_api/htmlcov | |
if-no-files-found: error | |
- name: Upload report to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
name: coverage_maria_latest | |
file: coverage.xml | |
fail_ci_if_error: true | |
verbose: true | |
working-directory: nc_py_api | |
- name: Upload NC logs | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: nc_log_maria_latest | |
path: data/nextcloud.log | |
if-no-files-found: warn | |
test-latest-pgsql-client: | |
needs: [analysis] | |
runs-on: ubuntu-22.04 | |
name: Latest • 🐘8.2 • 🐍3.12 • PgSQL | |
env: | |
NC_dbname: nextcloud_abz | |
services: | |
postgres: | |
image: postgres:16 | |
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@v4 | |
with: | |
python-version: '3.12-dev' | |
- name: Checkout server | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
repository: nextcloud/server | |
ref: "master" | |
- name: Checkout Notifications | |
uses: actions/checkout@v4 | |
with: | |
repository: nextcloud/notifications | |
ref: "master" | |
path: apps/notifications | |
- name: Checkout Activity | |
uses: actions/checkout@v4 | |
with: | |
repository: nextcloud/activity | |
ref: "master" | |
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 -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 . pytest coverage pillow | |
- name: Checkout Talk | |
uses: actions/checkout@v4 | |
with: | |
path: apps/spreed | |
repository: nextcloud/spreed | |
- name: Install Talk | |
working-directory: apps/spreed | |
run: | | |
make dev-setup | |
make build-js | |
- name: Enable Talk | |
run: php occ app:enable spreed | |
- name: Generate coverage report | |
working-directory: nc_py_api | |
run: | | |
coverage run -m pytest | |
coverage run --data-file=.coverage.at_the_end -m pytest tests/_tests_at_the_end.py | |
coverage combine && coverage xml && coverage html | |
env: | |
SKIP_AA_TESTS: 1 | |
NPA_NC_CERT: '' | |
- name: HTML coverage to artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage_pgsql_latest | |
path: nc_py_api/htmlcov | |
if-no-files-found: error | |
- name: Upload report to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
name: coverage_pgsql_latest | |
file: coverage.xml | |
fail_ci_if_error: true | |
verbose: true | |
working-directory: nc_py_api | |
- name: Upload NC logs | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: nc_log_pgsql_latest | |
path: data/nextcloud.log | |
if-no-files-found: warn | |
tests-sqlite: | |
needs: [analysis] | |
runs-on: ubuntu-22.04 | |
name: ${{ matrix.nextcloud }} • 🐘8.1 • 🐍3.11 • SQLite | |
strategy: | |
fail-fast: false | |
matrix: | |
nextcloud: [ 'stable26', 'stable27' ] | |
env: | |
NEXTCLOUD_URL: "http://localhost:8080/index.php" | |
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@v4 | |
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=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 notifications | |
./occ app:enable activity | |
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: cloud-py-api/app_api | |
- name: Patch base.php | |
if: ${{ startsWith(matrix.nextcloud, 'stable26') }} | |
run: patch -p 1 -i apps/app_api/base_php.patch | |
- 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 | |
make build-js | |
- name: Enable Talk | |
run: php occ app:enable spreed | |
- name: Generate coverage report | |
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 | |
coverage combine && coverage xml && coverage html | |
env: | |
NPA_TIMEOUT: None | |
NPA_TIMEOUT_DAV: None | |
NPA_NC_CERT: False | |
- name: HTML coverage to artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage_sqlite_${{ matrix.nextcloud }} | |
path: nc_py_api/htmlcov | |
if-no-files-found: error | |
- name: Upload report to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
name: coverage_sqlite_${{ matrix.nextcloud }} | |
file: coverage.xml | |
fail_ci_if_error: true | |
verbose: true | |
working-directory: nc_py_api | |
- name: Upload NC logs | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: nc_log_sqlite_${{ matrix.nextcloud }} | |
path: data/nextcloud.log | |
if-no-files-found: warn | |
tests-success: | |
permissions: | |
contents: none | |
runs-on: ubuntu-22.04 | |
needs: [tests-maria, tests-pgsql, tests-oci, tests-sqlite, tests-latest-maria-full, test-latest-pgsql-client] | |
name: Tests-OK | |
steps: | |
- run: echo "Tests passed successfully" |