diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..51cecd8 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,39 @@ +# A library commits no composer.lock, so CI resolves the newest versions on +# every run and audits them; Dependabot watches the constraints in +# composer.json and the actions. Minor and patch updates come once a week in +# one pull request per ecosystem; security updates as soon as they are +# published. +version: 2 +updates: + - package-ecosystem: composer + directory: / + schedule: + interval: weekly + day: monday + time: '06:00' + timezone: Europe/Sofia + open-pull-requests-limit: 5 + versioning-strategy: widen + groups: + composer: + applies-to: version-updates + update-types: [minor, patch] + composer-security: + applies-to: security-updates + patterns: ['*'] + + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + day: monday + time: '06:00' + timezone: Europe/Sofia + open-pull-requests-limit: 5 + groups: + actions: + applies-to: version-updates + update-types: [minor, patch] + actions-security: + applies-to: security-updates + patterns: ['*'] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b285fa9..eeef8e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,11 @@ on: permissions: contents: read +# A newer push to the same branch or pull request replaces a run still in progress. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: tests: name: PHP ${{ matrix.php }} @@ -17,9 +22,9 @@ jobs: matrix: php: ['8.3', '8.4', '8.5'] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: shivammathur/setup-php@v2 + - uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0 with: php-version: ${{ matrix.php }} extensions: bcmath, dom, libxml @@ -31,6 +36,12 @@ jobs: - name: Install dependencies run: composer update --no-interaction --no-progress --prefer-dist + # The newest versions the constraints allow, checked against the + # advisories: what a new install of this library gets. + - name: Composer audit + if: matrix.php == '8.4' + run: composer audit + - name: Coding standard if: matrix.php == '8.4' run: vendor/bin/php-cs-fixer fix --dry-run --diff @@ -48,8 +59,8 @@ jobs: name: Lowest dependencies (PHP 8.3) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 - - uses: shivammathur/setup-php@v2 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0 with: php-version: '8.3' extensions: bcmath, dom, libxml diff --git a/composer.json b/composer.json index ed13dd3..4cdf7b8 100644 --- a/composer.json +++ b/composer.json @@ -53,6 +53,7 @@ "cs": "php-cs-fixer fix --dry-run --diff", "cs:fix": "php-cs-fixer fix", "check": [ + "@composer audit", "@cs", "@analyse", "@test"