Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later

version: 2
updates:
- package-ecosystem: composer
directory: /
schedule:
interval: weekly
groups:
development-tooling:
dependency-type: development

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
143 changes: 143 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later

name: CI

on:
pull_request:
push:
branches:
- main

permissions:
contents: read

concurrency:
group: client-ci-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.4', '8.5']
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Set up PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: composer

- name: Validate Composer metadata
run: composer validate --strict

- name: Install dependencies
run: composer install --no-interaction --prefer-dist

- name: Test
run: composer test

coverage:
name: Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Set up PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
with:
php-version: '8.4'
coverage: xdebug
tools: composer

- name: Install dependencies
run: composer install --no-interaction --prefer-dist

- name: Measure coverage
run: composer test:coverage

- name: Enforce coverage threshold
run: php tests/coverage-threshold.php build/coverage.xml 75

quality:
name: Quality
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Set up PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
with:
php-version: '8.4'
coverage: none
tools: composer

- name: Install dependencies
run: composer install --no-interaction --prefer-dist

- name: Lint
run: composer lint

- name: Coding standard
run: composer phpcs

- name: Static analysis
run: composer phpstan

- name: Security audit
run: composer audit --no-interaction

scoping:
name: Namespace scoping
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Set up PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
with:
php-version: '8.4'
coverage: none
tools: composer

- name: Install dependencies
run: composer install --no-interaction --prefer-dist

- name: Install PHP-Scoper
run: composer global require --no-interaction humbug/php-scoper:^0.18.17

- name: Prefix package namespace
run: "$(composer global config bin-dir --absolute)/php-scoper" add-prefix --prefix=UsageStatisticsClientScoped --output-dir=build/scoped --force src

- name: Load scoped package
run: php tests/scoping-smoke.php

reuse:
name: REUSE
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: REUSE compliance
uses: fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5 # v6.0.0
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/vendor/
/build/
/.phpunit.cache/
/.phpunit.result.cache
/.phpstan-cache/
/coverage.xml
17 changes: 17 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--
SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
SPDX-License-Identifier: AGPL-3.0-or-later
-->

# Contributor notes

This is a small framework-agnostic Protocol v1 client. Keep runtime dependencies and the public API minimal.

- Source: `src/`
- Tests: `tests/`
- Design and integration notes: `docs/`
- Protocol source of truth: `LibreCodeCoop/usage_statistics_server/docs/protocol-v1.md`

Run `composer qa` and `composer audit` before committing. Validate scoping as described in `docs/development.md` when changing namespaces or public contracts.

Use Conventional Commits and `git commit -s`. Do not add application-specific LibreSign/Nextcloud code to the package core.
Loading