Skip to content

Commit

Permalink
Merge pull request #20 from stopfstedt/update_2024
Browse files Browse the repository at this point in the history
2024 Update
  • Loading branch information
jrjohnson authored Feb 14, 2024
2 parents 6bdc043 + 05b99a6 commit 051a015
Show file tree
Hide file tree
Showing 33 changed files with 1,315 additions and 2,212 deletions.
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: weekly
day: "sunday"
time: "02:30"
timezone: America/Los_Angeles
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
day: "sunday"
time: "02:30"
timezone: America/Los_Angeles
open-pull-requests-limit: 10
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ jobs:

strategy:
matrix:
php-version: [8.0]
php-version: [8.2, 8.3]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.php-version }}
- name: install dependencies
run: composer install --no-interaction --prefer-dist
- name: lint src
run: bin/phpcs --standard=PSR2 src
- name: lint tests
run: bin/phpcs --standard=PSR2 tests
- name: lint PHP
run: bin/phpcs
- name: static code analysis
run: bin/phpstan

tests:
name: PHPUnit Tests
Expand All @@ -38,10 +38,10 @@ jobs:

strategy:
matrix:
php-version: [8.0]
php-version: [8.2, 8.3]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/update_dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Update Dependencies

on:
workflow_dispatch:
schedule:
- cron: '15 14 * * 1' # weekly, on Monday morning (UTC)

env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ILIOS_DEPLOYMENT_WEBHOOK_URL }}

jobs:
update:
name: Tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Use PHP 8.2
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: 8.2
extensions: apcu
- name: install composer-lock-diff
run: composer global require davidrjonas/composer-lock-diff
- name: update dependencies
run: composer update
- name: Prepare Messages
id: vars
run: |
lockDiff="$(composer-lock-diff --md)"
# We have to manually escape new lines
lockDiff="${lockDiff//$'\n'/'%0A'}"
echo ::set-output name=pr_title::"Update Dependencies"
echo ::set-output name=commit_message::"Update Dependencies \
${lockDiff}."
echo ::set-output name=pr_body::"${lockDiff}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.ZORGBORT_TOKEN }}
title: ${{ steps.vars.outputs.pr_title }}
body: ${{ steps.vars.outputs.pr_body }}
commit-message: ${{ steps.vars.outputs.commit_message }}
branch: auto-update-dependencies
committer: Zorgbort <info@iliosproject.org>
author: Zorgbort <info@iliosproject.org>
labels: dependencies
- uses: act10ns/slack@v2.0.0
with:
status: ${{ job.status }}
message: Update Dependency Job Failed {{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}/actions/runs/{{ env.GITHUB_RUN_ID }}
if: failure()
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
*~
*.patch
/bin/*
/html-coverage/
/vendor/
.phpunit.result.cache
.phpunit.cache
.phpcs-cache
phpunit.xml

14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# MeSH Parser

This PHP code library provides tools for extracting [Medical Subject Headings](https://www.nlm.nih.gov/mesh/)
This PHP code library provides tools for extracting [Medical Subject Headings](https://www.nlm.nih.gov/mesh/meshhome.html)
(MeSH) descriptors and associated data from a given XML file into an object representation.

It expects its input to be compliant with the 2019 or 2020 [MeSH DTDs](https://www.nlm.nih.gov/databases/dtd/).
It expects its input to be compliant with the 2023 or 2024 [MeSH DTDs](https://www.nlm.nih.gov/databases/download/mesh.html).

## Installation

Expand All @@ -15,11 +15,11 @@ composer require ilios/mesh-parser

## Usage

Instantiate `\Ilios\MeSH\Parser` and invoke its `parse()` method with an URI that points at valid MeSH descriptors
Instantiate `\Ilios\MeSH\Parser` and invoke its `parse()` method with a URI that points at valid MeSH descriptors
XML file.
This method call will return an instance of `\Ilios\MeSH\Model\DescriptorSet`; this is the entry point into
the object representation of the descriptors data model.
Use getter methods on this object and its sub-components to traverse and process this model.
Use getter methods on this object and its subcomponents to traverse and process this model.

### Example

Expand All @@ -28,9 +28,9 @@ Use getter methods on this object and its sub-components to traverse and process

require __DIR__ . '/vendor/autoload.php';

// provide an URL or a local file path.
//$uri = 'ftp://nlmpubs.nlm.nih.gov/online/mesh/MESH_FILES/xmlmesh/desc2020.xml';
$uri = __DIR__ . '/desc2019.xml';
// provide a URL or a local file path.
//$uri = 'https://nlmpubs.nlm.nih.gov/projects/mesh/MESH_FILES/xmlmesh/desc2024.xml';
$uri = __DIR__ . '/desc2024.xml';

// instantiate the parser and parse the input.
$parser = new \Ilios\MeSH\Parser();
Expand Down
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"Ilios",
"MeSH"
],
"homepage": "http://iliosproject.org/",
"homepage": "https://iliosproject.org/",
"license": "MIT",
"authors": [
{
Expand All @@ -16,13 +16,16 @@
}
],
"require": {
"php": ">=8.0"
"php": ">=8.2",
"ext-dom": "*",
"ext-xmlreader": "*"
},
"require-dev": {
"mockery/mockery": "@stable",
"phpunit/phpunit": "@stable",
"squizlabs/php_codesniffer": "@stable",
"fakerphp/faker": "@stable"
"fakerphp/faker": "@stable",
"phpstan/phpstan": "^1.10"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit 051a015

Please sign in to comment.