Skip to content

feature/IVYPORTAL-17377-Create-pipeline-to-run-Lighthouse-report #22

feature/IVYPORTAL-17377-Create-pipeline-to-run-Lighthouse-report

feature/IVYPORTAL-17377-Create-pipeline-to-run-Lighthouse-report #22

name: lighthouse-report
run-name: Create Lighthouse Audit
on:
push:
branches:
- feature/IVYPORTAL-17377-Create-pipeline-to-run-Lighthouse-report
pull_request:
branches:
- master
env: # Define reusable environment variables
ENGINE_DIR: ${{ github.workspace }}/AxonIvyPortal/engine
ENGINE_URL: https://developer.axonivy.com/permalink/nightly/axonivy-engine.zip
jobs:
build:
runs-on: ubuntu-latest
name: Build Modules
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set Up Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.8
- name: Prepare Environment
run: |
mkdir -p $ENGINE_DIR
echo "Workspace prepared at ${{ github.workspace }}"
- name: Download Engine
run: |
echo "Downloading engine from $ENGINE_URL ..."
curl -L $ENGINE_URL -o engine.zip
unzip -q engine.zip -d $ENGINE_DIR

Check failure on line 44 in .github/workflows/lighthouse-report.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/lighthouse-report.yml

Invalid workflow file

You have an error in your yaml syntax on line 44
- name: Build Portal Modules
run: |
modules=(
"AxonIvyPortal/portal-components"
"AxonIvyPortal/portal"
"AxonIvyPortal/PortalKitTestHelper"
"Showcase/portal-user-examples"
"Showcase/portal-developer-examples"
"Showcase/InternalSupport"
"Showcase/portal-components-examples"
"AxonIvyPortal/PortalApp"
"Showcase/portal-demo-app"
)
# for module in "${modules[@]}"; do
# echo "Building $module..."
# mvn clean install -f $module/pom.xml -Divy.engine.directory=$ENGINE_DIR
done
# - name: Deploy Portal Modules
# run: |
# DEPLOYMENT=$ENGINE_DIR/system/demo-applications/demo-portal
# rm -rf $DEPLOYMENT/*
# cp Showcase/portal-demo-app/target/*.zip $DEPLOYMENT
# cp Showcase/portal-developer-examples/target/*.iar $DEPLOYMENT
# cp Showcase/portal-components-examples/target/*.iar $DEPLOYMENT
- name: Set JAVA_HOME for Axon Ivy Engine
run: |
export JAVA_HOME=/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.5-11/x64
export PATH=$JAVA_HOME/bin:$PATH
java -version
- name: Verify Engine Files
run: |
ls -l $ENGINE_DIR
ls -l $ENGINE_DIR/bin
- name: Start Axon Ivy Engine
run: |
cd $ENGINE_DIR/bin
./AxonIvyEngine
env:
JAVA_HOME: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.5-11/x64
PATH: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.5-11/x64/bin:$PATH
lighthouse-audit:
name: Lighthouse Audit
needs: build
runs-on: ubuntu-latest
steps:
- name: Install Lighthouse
run: npm install -g lighthouse
- name: Wait for Server to Be Ready
run: |
for ((i=1; i<=${{ env.WAIT_TIME }}; i++)); do
if curl -s ${{ env.SERVER_URL }} > /dev/null; then
echo "Server is ready"
exit 0
fi
echo "Waiting for server..."
sleep 1
done
echo "Server did not start in time" && exit 1
- name: Execute Lighthouse Audit
run: lighthouse ${{ env.SERVER_URL }} --output=json --output=html --output-path=${{ env.REPORT_PATH }}
- name: Upload Audit Report
uses: actions/upload-artifact@v3
with:
name: lighthouse-report
path: ${{ env.REPORT_PATH }}