Skip to content

Commit

Permalink
Merge pull request #1782 from ministryofjustice/LPAL-1081-pdf-82
Browse files Browse the repository at this point in the history
LPAL-1081 upgrade service-pdf to PHP 8.2
  • Loading branch information
nickdavis2001 authored May 13, 2024
2 parents fd14105 + 36ec8d8 commit d1a8fed
Show file tree
Hide file tree
Showing 34 changed files with 2,306 additions and 1,524 deletions.
29 changes: 2 additions & 27 deletions .github/workflows/analysis-psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
path: "./service-api"
- name: shared
path: "./shared"
- name: service-pdf
path: "./service-pdf"

defaults:
run:
Expand All @@ -46,30 +48,3 @@ jobs:
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: ${{ matrix.scan.path }}/psalm-results.sarif
psalm_all_php:
name: psalm-scan
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
scan:
- name: service-pdf
path: "./service-pdf"
defaults:
run:
working-directory: ${{ matrix.scan.path }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
- name: Composer install
run: composer install --prefer-dist --optimize-autoloader --no-suggest --no-interaction
- name: Run psalm
run: ./vendor/bin/psalm --output-format=github --report=psalm-results.sarif
- name: Upload Security Analysis results to GitHub
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: ${{ matrix.scan.path }}/psalm-results.sarif
45 changes: 1 addition & 44 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,49 +26,6 @@ jobs:
- name: shared
path: "./shared"
minCoverage: 91
defaults:
run:
working-directory: ${{ matrix.scan.path }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Configure AWS Credentials
if: matrix.scan.path == './service-api' # aws creds currently needed for service-api but dependency will be removed in LPAL-1075
uses: aws-actions/configure-aws-credentials@50ac8dd1e1b10d09dac7b8727528b91bed831ac0 # v3.0.2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_ACTIONS }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_ACTIONS }}
aws-region: eu-west-1
role-to-assume: arn:aws:iam::311462405659:role/opg-lpa-ci
role-duration-seconds: 1800
role-session-name: OPGMakeaLPAECRGithubAction
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
- name: pdftk install
if: matrix.scan.path == './service-pdf'
run: |
sudo apt-get update
sudo apt-get install pdftk-java
- name: Composer install
run: composer install --prefer-dist --optimize-autoloader --no-suggest --no-interaction
- name: Run phpunit
run: XDEBUG_MODE=coverage php ./vendor/bin/phpunit --coverage-html ./coverage-html --coverage-xml ./coverage-xml
- name: Check coverage
run: php ../scripts/pipeline/php_coverage/check_coverage.php ./coverage-xml/index.xml ${{ matrix.scan.minCoverage }}
- name: Upload Coverage Artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: coverage-html
path: ${{ matrix.scan.path }}/coverage-html/
phpunit_all_services:
name: phpunit
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
scan:
- name: service-pdf
path: "./service-pdf"
minCoverage: 85
Expand All @@ -91,7 +48,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
php-version: "8.2"
- name: pdftk install
if: matrix.scan.path == './service-pdf'
run: |
Expand Down
17 changes: 11 additions & 6 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 3 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,7 @@ services:
build:
context: ./
args:
# Ideally, debug would always be enabled for front-app, as we often want to debug it. In practice,
# this still runs too slowly so we leave it off as default
ENABLE_XDEBUG: 0
ENABLE_XDEBUG: 1
dockerfile: service-front/docker/app/Dockerfile
volumes:
- ./service-front:/app
Expand Down Expand Up @@ -256,9 +254,7 @@ services:
build:
context: ./
args:
# Enable debug is recommended to default to off for api to avoid slowness.
# Turn this on if you ever need to debug the api
ENABLE_XDEBUG: 0
ENABLE_XDEBUG: 1
OPG_LPA_COMMON_APP_VERSION: "${OPG_LPA_COMMON_APP_VERSION}"
dockerfile: service-api/docker/app/Dockerfile
volumes:
Expand Down Expand Up @@ -432,9 +428,7 @@ services:
build:
context: ./
args:
# Other containers are built with debug on. Lines could be put here to build pdf with debug,
# but not doing as default due to pdf being slow already
ENABLE_XDEBUG: 0
ENABLE_XDEBUG: 1
dockerfile: service-pdf/docker/app/Dockerfile
environment:
OPG_LPA_COMMON_PDF_CACHE_S3_BUCKET: "lpacache"
Expand Down
4 changes: 2 additions & 2 deletions service-api/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"laminas/laminas-db": "^2.13.4",
"symfony/console": "^6.1",
"laminas/laminas-cli": "^1.5",
"symfony/validator": "^4.2",
"egulias/email-validator": "~1.2"
"symfony/validator": "^7.0.2",
"egulias/email-validator": "^4.0.2"
},
"replace": {
"laminas/laminas-cache-storage-adapter-apc": "*",
Expand Down
Loading

0 comments on commit d1a8fed

Please sign in to comment.