Skip to content
Merged
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
27 changes: 16 additions & 11 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
name: Code Style
on: [pull_request]

permissions: {}

jobs:
phpcs:
name: phpcs
runs-on: ubuntu-latest
permissions:
code-quality: write

steps:
- name: Check out code into the workspace
uses: actions/checkout@v2
uses: actions/checkout@v6
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
with:
persist-credentials: false

- name: Install php
uses: shivammathur/setup-php@v2
Expand All @@ -16,29 +24,26 @@ jobs:
- name: Install dependencies
run: composer update --dev --no-interaction --prefer-dist --no-progress --no-suggest --ansi

- name: PHPCS check
uses: chekalsky/phpcs-action@v1
with:
phpcs_bin_path: './vendor/bin/phpcs'
enable_warnings: true
- name: Run phpcs
run: ./vendor/bin/phpcs -q --report=checkstyle src

phpstan:
name: phpstan
runs-on: ubuntu-latest
steps:
- name: Check out code into the workspace
uses: actions/checkout@v2
uses: actions/checkout@v6
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
with:
persist-credentials: false

- name: Install php
uses: shivammathur/setup-php@v2
with:
php-version: "7.4"
tools: phpstan

- name: Install dependencies
run: composer update --dev --no-interaction --prefer-dist --no-progress --no-suggest --ansi

- name: Require phpstan
run: composer require --dev phpstan/phpstan:"~2.1.56" --no-interaction

- name: Run phpstan
run: php ./vendor/phpstan/phpstan/phpstan.phar analyse --no-progress
run: phpstan analyse --no-progress
30 changes: 17 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,39 @@ on:

name: Create release

permissions: {}

jobs:
build:
name: Create release
runs-on: ubuntu-latest

permissions:
packages: write
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v6
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
with:
ref: ${{ github.head_ref }}

- name: Replace version constant
run: |
sed -i "s/VERSION\s*=\s*[^;]*/VERSION = '${{ github.event.inputs.version }}'/g" ./src/Fpdi.php ./src/Tcpdf/Fpdi.php ./src/Tfpdf/Fpdi.php
sed -i "s/VERSION\s*=\s*[^;]*/VERSION = '${NEW_VERSION}'/g" ./src/Fpdi.php ./src/Tcpdf/Fpdi.php ./src/Tfpdf/Fpdi.php
env:
NEW_VERSION: ${{ github.event.inputs.version }}

- name: Commit and push version constant update
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v7
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
with:
commit_message: Updated version constant
push_options: --force

- name: Declare actual commit sha
id: actual_commit_sha
shell: bash
run: echo "::set-output name=sha::$(git rev-parse HEAD)"
- name: Create Release
id: create_release
uses: actions/create-release@v1
run: |
gh release create --draft --title "FPDI ${title}" "v${tag}"
env:
NEW_VERSION: ${{ github.event.inputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commitish: ${{ steps.actual_commit_sha.outputs.sha }}
tag_name: v${{ github.event.inputs.version }}
release_name: FPDI ${{ github.event.inputs.version }}
draft: true
13 changes: 11 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Tests
on: [pull_request]

permissions: {}

jobs:
tests:
name: Run PHP Unit tests
Expand All @@ -9,7 +12,9 @@ jobs:
php: ['7.2', '7.3']
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v6
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
with:
persist-credentials: false

- name: Install mupdf and imagemagick
run: sudo apt-get install mupdf-tools imagemagick
Expand All @@ -18,6 +23,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
coverage: none

- name: Install dependencies
run: composer update --dev --no-interaction --prefer-dist --no-progress --no-suggest --ansi
Expand All @@ -34,7 +40,9 @@ jobs:
php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v6
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
with:
persist-credentials: false

- name: Install mupdf and imagemagick
run: sudo apt-get install mupdf-tools imagemagick
Expand All @@ -43,6 +51,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
coverage: none

- name: Upgrade phpunit
run: composer require --dev --with-all-dependencies "phpunit/phpunit=^9.0"
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: GitHub Actions Security Analysis with zizmor 🌈

on:
push:
branches: ["main"]
branches: ["master"]
pull_request:
branches: ["**"]

Expand All @@ -14,11 +14,9 @@ jobs:
runs-on: ubuntu-latest
permissions:
security-events: write # Required for upload-sarif (used by zizmor-action) to upload SARIF files.
contents: read # Only needed for private repos. Needed to clone the repo.
actions: read # Only needed for private repos. Needed for upload-sarif to read workflow run info.
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@v6
with:
persist-credentials: false

Expand Down
3 changes: 3 additions & 0 deletions .github/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rules:
unpinned-uses:
disable: true