Skip to content
Draft
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
225 changes: 132 additions & 93 deletions .github/workflows/inferno-test.yml
Original file line number Diff line number Diff line change
@@ -1,100 +1,139 @@
name: Inferno Certification Test

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
push:
branches:
- master
pull_request:
branches:
- master

permissions:
contents: read
contents: read

jobs:
check_secret:
runs-on: ubuntu-24.04
name: Check Required Secret
outputs:
has_inferno_pat: ${{ steps.check.outputs.has_inferno_pat }}
steps:
- name: Check if INFERNO_PAT is available
id: check
run: |
if [ -z "${{ secrets.INFERNO_PAT }}" ]; then
echo "::warning::INFERNO_PAT secret is not set. Inferno certification tests will be skipped."
echo "To run these tests, please set the INFERNO_PAT secret in your repository settings."
echo "has_inferno_pat=false" >> $GITHUB_OUTPUT
else
echo "INFERNO_PAT secret is available. Proceeding with tests."
echo "has_inferno_pat=true" >> $GITHUB_OUTPUT
fi

inferno_certification_test:
needs: check_secret
runs-on: ubuntu-24.04
name: Inferno Certification Test
timeout-minutes: 180 # 3 hours timeout due to potential terminology downloads
if: needs.check_secret.outputs.has_inferno_pat == 'true'
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
token: ${{ secrets.INFERNO_PAT }}

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: mbstring, xml, ctype, json, tokenizer, openssl, pdo, pdo_mysql

- name: Install npm package
uses: actions/setup-node@v4
with:
node-version: '22'

- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ~/.composer/cache/files
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-

- name: Cache node modules
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log Docker info
run: |
docker --version
docker compose version

- name: Make run.sh executable
run: chmod +x ci/inferno/run.sh

- name: Install OpenEMR-cmd
run: |
mkdir ~/bin
curl -L https://raw.githubusercontent.com/openemr/openemr-devops/master/utilities/openemr-cmd/openemr-cmd > ~/bin/openemr-cmd
chmod +x ~/bin/openemr-cmd
# add the command to default path so will be found and run.sh can still be used locally

- name: Run Inferno Certification Tests
working-directory: ci/inferno
run: |
set -e
echo "Starting Inferno certification test suite..."
./run.sh
echo "Inferno certification tests completed successfully"

- name: Cleanup Docker resources
if: always()
run: |
docker compose -f ci/inferno/compose.yml down -v || true
docker system prune -f || true
check_secret:
runs-on: ubuntu-24.04
name: Check Required Secret
outputs:
has_inferno_pat: ${{ steps.check.outputs.has_inferno_pat }}
steps:
- name: Check if INFERNO_PAT is available
id: check
run: |
if [[ -n '${{ secrets.INFERNO_PAT }}' ]]; then
echo 'INFERNO_PAT secret is available. Proceeding with tests.'
echo 'has_inferno_pat=true' >> "$GITHUB_OUTPUT"
else
echo '::warning::INFERNO_PAT secret is not set. Inferno certification tests will be skipped.'
echo 'To run these tests, please set the INFERNO_PAT secret in your repository settings.'
echo 'has_inferno_pat=false' >> "$GITHUB_OUTPUT"
fi

inferno_certification_test:
needs: check_secret
runs-on: ubuntu-24.04
name: Inferno Certification Test
timeout-minutes: 180 # 3 hours timeout due to potential terminology downloads
if: needs.check_secret.outputs.has_inferno_pat == 'true'
strategy:
matrix:
# Single-element matrix provides named variable and job title
php-version: ['8.4']
node-version: ['22']
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
token: ${{ secrets.INFERNO_PAT }}

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}

- name: Get composer cache directory
id: composer-cache
run: |
{
printf 'dir='
composer config cache-files-dir
} >> "$GITHUB_OUTPUT"

- name: Composer Cache
uses: actions/cache/restore@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php-version }}-
${{ runner.os }}-composer-

- name: Composer Install
run: composer install --prefer-dist --no-progress

- name: Save composer cache
uses: actions/cache/save@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}

- name: Install npm package
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Get NPM Cache Directory
id: npm-cache-dir
run: |
{
printf 'dir='
npm config get cache
} >> "$GITHUB_OUTPUT"

- name: Cache node modules
uses: actions/cache/restore@v4
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node-version }}-
${{ runner.os }}-node-

- name: NPM CI
run: npm ci

- name: Save node cache
uses: actions/cache/save@v4
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log Docker info
run: |
docker --version
docker compose version

- name: Install OpenEMR-cmd
run: |
mkdir -p "$HOME/bin"
curl -sSfL https://raw.githubusercontent.com/openemr/openemr-devops/master/utilities/openemr-cmd/openemr-cmd > "$HOME/bin/openemr-cmd"
chmod +x "$HOME/bin/openemr-cmd"
# add the command to default path so will be found and run.sh can still be used locally

- name: Run Inferno Certification Tests
working-directory: ci/inferno
shell: bash
run: |
echo 'Starting Inferno certification test suite…'
./run.sh
echo 'Inferno certification tests completed successfully'

- name: Cleanup Docker resources
if: always()
run: |
docker compose -f ci/inferno/compose.yml down --volumes --remove-orphans || true
docker system prune -f || true
55 changes: 33 additions & 22 deletions .github/workflows/js-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: JS Unit Test

on:
push:
branches: [ master ]
branches:
- master
pull_request:
branches: [ master ]
branches:
- master

permissions:
contents: read
Expand All @@ -14,24 +16,33 @@ jobs:
js_unit_test:
runs-on: ubuntu-24.04
name: JS Unit Test
strategy:
matrix:
# Single-element matrix provides named variable and job title
node-version: ['22']
steps:
- uses: actions/checkout@v4

- name: Install npm package
uses: actions/setup-node@v4
with:
node-version: '22'

- name: Cache node modules
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: npm install
run: npm ci

- name: Run Unit Tests
run: npm run test:js
- name: Checkout code
uses: actions/checkout@v4
- name: Install npm package
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Get NPM Cache Directory
id: npm-cache-dir
run: |
{
printf 'dir='
npm config get cache
} >> "$GITHUB_OUTPUT"
- name: Cache node modules
uses: actions/cache@v4
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node-version }}-
${{ runner.os }}-node-
- name: NPM CI
run: npm ci
- name: Run Unit Tests
run: npm run test:js
33 changes: 29 additions & 4 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,43 @@ permissions:
jobs:
phpstan:
runs-on: ubuntu-24.04
strategy:
matrix:
# Single-element matrix provides named variable and job title
php-version: ['8.4']
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none
- name: Get composer cache directory
id: composer-cache
run: |
{
printf 'dir='
composer config cache-files-dir
} >> $GITHUB_OUTPUT
- name: Composer Cache
uses: actions/cache@v4
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php-version }}-
${{ runner.os }}-composer-
- name: Composer Install
uses: php-actions/composer@v6
run: composer install --prefer-dist --no-progress
- name: PHPStan Cache
# https://phpstan.org/user-guide/result-cache
uses: actions/cache@v4
with:
php_extensions: gd soap zip
path: tmp-phpstan # same as in phpstan.neon
key: "phpstan-result-cache-${{ github.run_id }}"
restore-keys: |
phpstan-result-cache-
- name: PHPStan Diagnose
if: ${{ env.ACTIONS_STEP_DEBUG == 'true' }}
uses: php-actions/phpstan@v3
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/rector.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Rector PHP Analysis

on:
push:
branches:
- master
pull_request:
branches:
- master
Expand All @@ -9,17 +12,19 @@ jobs:
rector:
name: Rector PHP Analysis
runs-on: ubuntu-latest

strategy:
matrix:
# Single-element matrix provides named variable and job title
php-version: ['8.4']
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
php-version: ${{ matrix.php-version }}
coverage: none
tools: composer:v2

- name: Get composer cache directory
id: composer-cache
Expand All @@ -29,8 +34,9 @@ jobs:
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php-version }}-
${{ runner.os }}-composer-

- name: Install dependencies
Expand Down
Loading
Loading