Initial commit #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: @MODULE_NAME@ Test Suites | ||
# We are a reusable Workflow only | ||
on: | ||
workflow_call: | ||
secrets: | ||
SLACK_WEBHOOK_URL: | ||
required: false | ||
jobs: | ||
tests: | ||
name: Tests | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
DB_USER: root | ||
DB_PASSWORD: root | ||
continue-on-error: ${{ matrix.experimental }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ "ubuntu-latest", "windows-latest" ] | ||
jdkVersion: [ "17" ] | ||
experimental: [false] | ||
#include: | ||
#- jdkVersion: "17" | ||
# os: "windows-latest" | ||
# experimental: true | ||
# Disabled for now until we can figure out the gradle matrix | ||
#- jdkVersion: "17" | ||
# os: "ubuntu-latest" | ||
# experimental: true | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: "temurin" | ||
java-version: ${{ matrix.jdkVersion }} | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v3 | ||
with: | ||
gradle-version: "8.7" | ||
# - name: Setup Database and Fixtures | ||
# run: | | ||
# sudo systemctl start mysql.service | ||
# mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} -e 'CREATE DATABASE mementifier;' | ||
# mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < test-harness/tests/resources/coolblog.sql | ||
#- name: Setup CommandBox CLI | ||
# uses: Ortus-Solutions/[email protected] | ||
# Not Needed in this module | ||
#- name: Setup Environment For Testing Process | ||
# run: | | ||
# # Setup .env | ||
# touch .env | ||
# # ENV | ||
# printf "DB_HOST=localhost\n" >> .env | ||
# printf "DB_DATABASE=mydatabase\n" >> .env | ||
# printf "DB_DRIVER=MySQL\n" >> .env | ||
# printf "DB_USER=${{ env.DB_USER }}\n" >> .env | ||
# printf "DB_PASSWORD=${{ env.DB_PASSWORD }}\n" >> .env | ||
# printf "DB_CLASS=com.mysql.cj.jdbc.Driver\n" >> .env | ||
# printf "DB_BUNDLEVERSION=8.0.19\n" >> .env | ||
# printf "DB_BUNDLENAME=com.mysql.cj\n" >> .env | ||
- name: Test Module | ||
run: | | ||
gradle downloadBoxLang | ||
gradle test --stacktrace --console=plain | ||
- name: Upload Test Results | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: tests-${{ matrix.os }}-${{ matrix.jdkVersion }} | ||
path: | | ||
**/build/reports/tests/** | ||
**/build/test-results/** | ||
publish-test-results: | ||
name: Publish Test Results | ||
runs-on: ubuntu-latest | ||
needs: tests | ||
if: always() | ||
permissions: | ||
checks: write | ||
pull-requests: write | ||
contents: read | ||
issues: read | ||
steps: | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: artifacts | ||
- name: Publish Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
with: | ||
files: | | ||
artifacts/**/*.xml |