Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/development' into feature/DIMOC-…
Browse files Browse the repository at this point in the history
…208/fileupload-fe
  • Loading branch information
remko48 committed Aug 7, 2024
2 parents 9185381 + aa981c7 commit 98d2d45
Show file tree
Hide file tree
Showing 202 changed files with 13,166 additions and 14,892 deletions.
120 changes: 120 additions & 0 deletions .github/workflows/CI-workflows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: CI Workflow

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: mbstring, zip, xml, curl, intl, sqlite, gd, pdo_mysql
tools: cs2pr, phpcbf, phpcs, phpmd, phpunit

- name: Install Composer dependencies
run: composer install

- name: Run phpcbf
run: phpcbf .
continue-on-error: ${{ github.ref != 'refs/heads/main' }}

- name: Commit code formatting changes
if: success() && github.ref != 'refs/heads/main'
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add src
git diff --cached --quiet || (git commit -m "Update src from PHP Codesniffer" && git pull origin $(git rev-parse --abbrev-ref HEAD) --rebase --autostash && git push)
- name: Run phpcs
run: phpcs -q --report=checkstyle src | cs2pr
continue-on-error: ${{ github.ref != 'refs/heads/main' }}

- name: Run phpmd
run: phpmd src xml phpmd.xml --not-strict
continue-on-error: ${{ github.ref != 'refs/heads/main' }}

- name: List files in repository root
run: ls -alh

- name: List files in tests directory
run: ls -alh ./tests

- name: List files in vendor directory
run: ls -alh ./vendor

- name: Run PHPUnit tests
env:
XDEBUG_MODE: coverage
run: |
phpunit --bootstrap ./tests/bootstrap.php --configuration phpunit.xml --coverage-html ./coverage --coverage-text | tee coverage.txt
continue-on-error: ${{ github.ref != 'refs/heads/main' }}

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install remark presets
run: npm install remark-cli remark-preset-lint-consistent remark-preset-lint-recommended remark-lint-list-item-indent
- name: Run remark
run: npx remark . --output --use remark-preset-lint-consistent --use remark-preset-lint-recommended --use remark-lint-list-item-indent
- name: Check for linting errors
run: |
npx remark . --use remark-preset-lint-consistent --use remark-preset-lint-recommended --use remark-lint-list-item-indent
continue-on-error: ${{ github.ref != 'refs/heads/main' }}
- name: Git commit
if: success() && github.ref != 'refs/heads/main'
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add .
git add package.json package-lock.json
git diff --cached --quiet || (git commit -m "Update src from remark-lint" && git pull origin $(git rev-parse --abbrev-ref HEAD) --rebase --autostash && git push)
checks:
needs: [build, lint]
runs-on: ubuntu-latest

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

- name: Setup PHP (for checks)
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: mbstring, zip, xml, curl, intl, sqlite, gd, pdo_mysql
tools: cs2pr, phpcs, phpmd, phpunit

- name: Run Checks
run: |
if ! command -v phpcs &> /dev/null; then
echo "phpcs could not be found. Please ensure it's installed."
exit 1
fi
if ! command -v phpmd &> /dev/null; then
echo "phpmd could not be found. Please ensure it's installed."
exit 1
fi
if phpcs -q --report=checkstyle src | grep -q "ERROR"; then
echo "PHP CodeSniffer found issues. Please fix them before merging."
exit 1
fi
if phpmd src xml phpmd.xml --strict | grep -q "ERROR"; then
echo "PHP Mess Detector found issues. Please fix them before merging."
exit 1
fi
# if ! phpunit --bootstrap ./tests/bootstrap.php --configuration phpunit.xml; then
# echo "PHPUnit tests failed. Please fix them before merging."
# exit 1
#fi
if ! npx remark . --use remark-preset-lint-consistent --use remark-preset-lint-recommended --use remark-lint-list-item-indent; then
echo "Markdown linting failed. Please fix them before merging."
exit 1
fi
continue-on-error: false
42 changes: 19 additions & 23 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
{
"files.autoSave": "afterDelay",
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit",
"source.fixAll": false,
},
"editor.formatOnSave": true,
"eslint.format.enable": true,

"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},

"cSpell.words": [
"gedepubliceerd",
"depubliceren",
"Depubliceren",
"Matadata",
"nextcloud",
"opencatalogi",
"pinia",
"Toegangs"
],
"files.autoSave": "afterDelay",
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true,
"eslint.format.enable": true,
"cSpell.words": [
"depubliceren",
"Depubliceren",
"gedepubliceerd",
"Matadata",
"nextcloud",
"opencatalogi",
"organisation",
"Organisation",
"pinia",
"Toegangs"
],
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
}
3 changes: 3 additions & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
'resources' => [
'metadata' => ['url' => '/api/metadata'],
'publications' => ['url' => '/api/publications'],
'organisations' => ['url' => '/api/organisations'],
'themes' => ['url' => '/api/themes'],
'attachments' => ['url' => '/api/attachments'],
'catalogi' => ['url' => '/api/catalogi'],
'directory' => ['url' => '/api/directory']
Expand All @@ -17,6 +19,7 @@
['name' => 'search#index', 'url' => '/api/search', 'verb' => 'GET'],
['name' => 'search#show', 'url' => '/api/search/{id}', 'verb' => 'GET'],
['name' => 'directory#page', 'url' => '/directory', 'verb' => 'GET'],
['name' => 'directory#add', 'url' => '/api/directory/add', 'verb' => 'POST'],
['name' => 'configuration#index', 'url' => '/configuration', 'verb' => 'GET'],
['name' => 'configuration#create', 'url' => '/configuration', 'verb' => 'POST']
],
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"adbario/php-dot-notation": "^3.3.0",
"bamarni/composer-bin-plugin": "^1.8",
"elasticsearch/elasticsearch": "^v8.14.0",
"guzzlehttp/guzzle": "^7.8",
"adbario/php-dot-notation": "^3.3.0",
"guzzlehttp/guzzle": "^7.0",
"symfony/uid": "^6.4"
},
"require-dev": {
Expand Down
Loading

0 comments on commit 98d2d45

Please sign in to comment.