diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6fe9d7b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +name: Plugins CI + +on: + pull_request: + types: [opened, synchronize, reopened, edited] + push: + branches: + - '**.x-dev' + workflow_dispatch: + +permissions: + actions: read + contents: read + pull-requests: read + +jobs: + ci: + uses: matomo-org/plugin-ci-workflows/.github/workflows/plugin-ci.yml@main + with: + plugin-name: CustomVariables + # PHPStan has never run here and there is no phpstan.neon to run it with; + # adding one is a decision of its own. + skip-phpstan: true diff --git a/.github/workflows/matomo-ai-checklist.yml b/.github/workflows/matomo-ai-checklist.yml deleted file mode 100644 index cc2c022..0000000 --- a/.github/workflows/matomo-ai-checklist.yml +++ /dev/null @@ -1,32 +0,0 @@ -# Action for running tests - -name: AI Checklist - -on: - pull_request: - types: [opened, synchronize, reopened, edited] - -permissions: - actions: read - checks: none - contents: none - deployments: none - issues: none - packages: none - pull-requests: read - repository-projects: none - security-events: none - statuses: none - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - AiChecklist: - runs-on: ubuntu-24.04 - strategy: - fail-fast: false - steps: - - name: Run tests - uses: matomo-org/github-action-checklist-gate@main diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml deleted file mode 100644 index c2feadc..0000000 --- a/.github/workflows/phpcs.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: PHPCS check - -on: pull_request - -permissions: - actions: read - checks: read - contents: read - deployments: none - issues: read - packages: none - pull-requests: read - repository-projects: none - security-events: none - statuses: read - -jobs: - phpcs: - name: PHPCS - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - with: - lfs: false - persist-credentials: false - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.1' - tools: cs2pr - - name: Install dependencies - run: - composer init --name=matomo/customvariables --quiet; - composer --no-plugins config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true -n; - composer config repositories.matomo-coding-standards vcs https://github.com/matomo-org/matomo-coding-standards -n; - composer require matomo-org/matomo-coding-standards:dev-master; - composer install --dev --prefer-dist --no-progress --no-suggest - - name: Check PHP code styles - id: phpcs - run: ./vendor/bin/phpcs --report-full --standard=phpcs.xml --report-checkstyle=./phpcs-report.xml - - name: Show PHPCS results in PR - if: ${{ always() && steps.phpcs.outcome == 'failure' }} - run: cs2pr ./phpcs-report.xml --prepend-filename diff --git a/.github/workflows/weekly-branch-sweep.yml b/.github/workflows/weekly-branch-sweep.yml new file mode 100644 index 0000000..765208b --- /dev/null +++ b/.github/workflows/weekly-branch-sweep.yml @@ -0,0 +1,25 @@ +# Dispatches this plugin's build for each maintained branch that is not the default one, because +# GitHub only ever runs `schedule` from the default branch's copy of a workflow file. The logic +# lives in matomo-org/plugin-ci-workflows; see the "Branch sweep" section of its README.md for +# why this dispatches rather than building another branch's source here. + +name: Weekly branch sweep + +on: + schedule: + # Sunday, so it does not compete with this plugin's own Saturday build. Keeps the minute and + # hour of matomo-tests.yml's cron, so the fleet stays staggered across the window. + - cron: '0 3 * * 0' + workflow_dispatch: + +permissions: {} + +jobs: + sweep: + # Granted by the caller because permissions can only be maintained or reduced down a call + # chain, never elevated: the called workflow declares these too, but that can only cap them, + # not supply them, so without this block the dispatch is unauthorised. + permissions: + actions: write + contents: read + uses: matomo-org/plugin-ci-workflows/.github/workflows/plugin-branch-sweep.yml@main