Skip to content

Commit

Permalink
chore: merge pull request #245 from dvsa/backend-migration
Browse files Browse the repository at this point in the history
chore: migrate olcs-backend to vol-app monorepo
  • Loading branch information
jerotire authored Aug 16, 2024
2 parents c286449 + 5eb7866 commit 0acdc6d
Show file tree
Hide file tree
Showing 7,726 changed files with 781,291 additions and 3 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
17 changes: 17 additions & 0 deletions app/api/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# http://editorconfig.org

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.php]
indent_size = 4
47 changes: 47 additions & 0 deletions app/api/.github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
versioning-strategy: "increase-if-necessary"
schedule:
interval: "weekly"
groups:
composer-dependencies:
patterns:
- "*"

- package-ecosystem: "composer"
directory: "/vendor-bin/phpcs"
schedule:
interval: "weekly"
groups:
composer-dependencies:
patterns:
- "*"

- package-ecosystem: "composer"
directory: "/vendor-bin/phpstan"
schedule:
interval: "weekly"
groups:
composer-dependencies:
patterns:
- "*"

- package-ecosystem: "composer"
directory: "/vendor-bin/psalm"
schedule:
interval: "weekly"
groups:
composer-dependencies:
patterns:
- "*"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
github-action-dependencies:
patterns:
- "*"
24 changes: 24 additions & 0 deletions app/api/.github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CD

on:
push:
branches:
- main

jobs:
release-please:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
tag_name: ${{ steps.release.outputs.tag_name }}
release_created: ${{ steps.release.outputs.release_created }}
sha: ${{ steps.release.outputs.sha }}
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: php
package-name: olcs-backend
23 changes: 23 additions & 0 deletions app/api/.github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI

on:
pull_request:
schedule:
- cron: '0 0 * * 1'

jobs:
security:
uses: dvsa/.github/.github/workflows/php-security.yml@main
secrets:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

static-analysis:
uses: ./.github/workflows/static-analysis.yaml
with:
php-version: '8.2'

tests:
uses: dvsa/.github/.github/workflows/php-tests.yml@main
with:
php-versions: '["8.2"]'
fail-fast: false
83 changes: 83 additions & 0 deletions app/api/.github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Static analysis

on:
workflow_call:
inputs:
php-version:
required: false
type: string
default: 'latest'
composer-version:
required: false
type: string
default: 'v2'

jobs:
phpstan:

name: PHPStan - ${{ inputs.php-version }}
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php-version }}
coverage: none
tools: phpstan, composer:${{ inputs.composer-version }}

- name: Install Composer dependancies
run: composer install --no-progress --no-interaction

- name: Execute PHPStan
run: phpstan analyze --no-progress

php-codesniffer:

name: PHP-CodeSniffer - ${{ inputs.php-version }}
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php-version }}
coverage: none
tools: php-cs-fixer, phpcs, composer:${{ inputs.composer-version }}

- name: Install Composer dependancies
run: composer install --no-progress --no-interaction

- name: Execute PHP CodeSniffer
run: phpcs -q

psalm:

name: Psalm - ${{ inputs.php-version }}
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php-version }}
coverage: none
extensions: mbstring, intl, redis-phpredis/[email protected]
tools: vimeo/psalm, composer:${{ inputs.composer-version }}
env:
REDIS_CONFIGURE_OPTS: --enable-redis-igbinary

- name: Install Composer dependancies
run: composer install --no-progress --no-interaction

- name: Execute Psalm
run: psalm --no-progress --output-format=github --root=${GITHUB_WORKSPACE}
32 changes: 29 additions & 3 deletions app/api/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
*
!.gitignore
# Trigger CD - 08-08-2024 13:55.
nbproject
._*
.buildpath
.DS_Store
.idea
.project
.settings
composer.phar
vendor
vendor/bin
test/coverage-report
*.sw?
data/mapping
data/db/Etl
data/db/live-like-data.sql
data/db/test-olcs-refdata.sql
test/coverage/
.scannerwork/
config/development.config.php
vendor-bin/**/composer.lock
.phpunit.result.cache

# Non-dist files for the static analysis.
# This allows developers to set a different (more strict) static analysis locally.
phpcs.xml
phpstan.neon
phpunit.xml
psalm.xml

18 changes: 18 additions & 0 deletions app/api/.phpstorm.meta.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace PHPSTORM_META {
override(
\Dvsa\Olcs\Api\Domain\CommandHandler\AbstractCommandHandler::getRepo(0),
type(0)
);

override(
\Dvsa\Olcs\Api\Domain\QueryHandler\AbstractQueryHandler::getRepo(0),
type(0)
);

override(
\Dvsa\Olcs\Api\Domain\RepositoryManagerAwareTrait::getRepo(0),
type(0)
);
}
20 changes: 20 additions & 0 deletions app/api/.snyk
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.25.0
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
ignore:
'snyk:lic:composer:simplesamlphp:saml2:LGPL-2.1':
- '*':
reason: None Given
expires:
created: 2024-02-28T13:46:06.971Z
'snyk:lic:composer:phprtflite:phprtflite:GPL-3.0':
- '*':
reason: None Given
expires:
created: 2024-02-28T13:46:27.880Z
'snyk:lic:composer:behat:transliterator:Artistic-1.0':
- '*':
reason: None Given
expires:
created: 2024-02-28T13:46:38.578Z
patch: {}
1 change: 1 addition & 0 deletions app/api/LICENCE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The MIT License (MIT)Copyright (c) 2016 HM Government (Driver and Vehicle Standards Agency)Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Expand Down
Loading

0 comments on commit 0acdc6d

Please sign in to comment.