Skip to content

Run PresideCMS test suite #64

Run PresideCMS test suite

Run PresideCMS test suite #64

Workflow file for this run

name: Run PresideCMS test suite
on:
workflow_dispatch:
inputs:
compile:
required: false
default: false
type: boolean
workflow_call:
jobs:
setup-presidecms:
runs-on: ubuntu-latest
steps:
- name: Checkout PresideCMS Repository
uses: actions/checkout@v4
with:
repository: pixl8/Preside-CMS
- name: Checkout
uses: actions/checkout@v4
with:
path: _custom
- name: Copy custom test runner tweaks
run: |
cp -R _custom/custom/presidecms/tests/* tests
rm -rf _custom
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
- name: Install the ortus security key
run: curl -fsSl https://downloads.ortussolutions.com/debs/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/ortussolutions.gpg > /dev/null
- name: Add the commandbox source
run: echo "deb [signed-by=/usr/share/keyrings/ortussolutions.gpg] https://downloads.ortussolutions.com/debs/noarch /" | sudo tee /etc/apt/sources.list.d/commandbox.list
- name: Update apt and install commandbox
run: sudo apt-get update && sudo apt-get install apt-transport-https commandbox
- name: Install dependencies
run: |
box install verbose=true system=false
- name: installed webroot for matrix steps
uses: actions/upload-artifact@v4
with:
name: webroot
include-hidden-files: true
path: ${{ github.workspace }}
run-preside-tests:
name: Preside CI
runs-on: ubuntu-latest
needs: [ setup-presidecms ]
strategy:
fail-fast: false
max-parallel: 1
matrix:
luceeVersion: [ 6.2/snapshot/jar ]
javaVersion: [ 21 ]
keySize: [ 0, 767,1535,3071,6143,12287, 24575, 49151 ]
env:
luceeVersionQuery: ${{ matrix.luceeVersion }}
compile: ${{ github.event.inputs.compile }}
LUCEE_CACHE_VARIABLEKEYS: ${{ matrix.keySize }}
steps:
- name: Restore pre-prepared webroot
uses: actions/download-artifact@v4
with:
name: webroot
path: ${{ github.workspace }}
- name: Set up JDK ${{ matrix.javaVersion }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.javaVersion }}
distribution: 'adopt'
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: maven-cache
- name: Cache Lucee files
uses: actions/cache@v4
with:
path: /home/runner/work/_actions/lucee/script-runner/main/lucee-download-cache
key: lucee-downloads
- name: Set up MySQL (local)
run: |
sudo systemctl start mysql
mysql -e 'CREATE DATABASE preside_test' -uroot -proot
mysql -e 'CREATE USER "preside"@"localhost" IDENTIFIED WITH mysql_native_password BY "preside";' -uroot -proot
mysql -e 'GRANT ALL PRIVILEGES ON preside_test.* TO "preside"@"localhost"' -uroot -proot
- name: fix testbox
run: |
mkdir -p tests/testbox/system/stubs
ls -lRa tests
- name: Run Preside CMS Test Suite
uses: lucee/script-runner@main
with:
webroot: ${{ github.workspace }}/tests
execute: /runtests.cfm
luceeVersionQuery: ${{ env.luceeVersionQuery }}
compile: ${{ env.compile }}
env:
PRESIDETEST_DB_PORT: 3306
PRESIDETEST_DB_HOST: localhost
PRESIDETEST_DB_USER: preside
PRESIDETEST_DB_PASSWORD: preside
PRESIDETEST_DB_NAME: preside_test
LUCEE_BASE_CONFIG: ${{ github.workspace }}/tests/.cfconfig.json
- uses: actions/upload-artifact@v4
if: always()
with:
name: results-${{ strategy.job-index }}
path: ${{ github.workspace }}/tests/artifacts
report:
runs-on: ubuntu-latest
if: always()
needs: [ run-preside-tests ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: "temurin"
- name: Cache Maven packages
if: always()
uses: actions/cache@v4
with:
path: ~/.m2
key: maven-cache
- name: Cache Lucee files
uses: actions/cache@v4
if: always()
with:
path: /home/runner/work/_actions/lucee/script-runner/main/lucee-download-cache
key: lucee-downloads
- uses: actions/download-artifact@v4
with:
path: ${{ github.workspace }}/custom/spreadsheet-cfml/test/artifacts
merge-multiple: true
pattern: results-*
- name: Display structure of downloaded files
run: ls -R ${{ github.workspace }}/custom/spreadsheet-cfml/test/artifacts
- name: Generate Report
uses: lucee/script-runner@main
with:
webroot: ${{ github.workspace }}/custom/spreadsheet-cfml/test
execute: /report.cfm
luceeVersionQuery: 6/stable/light
- uses: actions/upload-artifact@v4
if: always()
with:
name: all-results
path: ${{ github.workspace }}/custom/spreadsheet-cfml/test/artifacts