James c iss2602 3270 tab not loading #812
Workflow file for this run
This file contains hidden or 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
| # | |
| # Copyright contributors to the Galasa project | |
| # | |
| # SPDX-License-Identifier: EPL-2.0 | |
| # | |
| name: PR build | |
| on: | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| detect-secrets: | |
| name: Detect secrets in this Pull Request | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Turn script into an executable | |
| run: chmod +x detect-secrets.sh | |
| - name: Run the detect secrets script | |
| run: ./detect-secrets.sh | |
| build-webui: | |
| name: Build the Galasa Web UI | |
| runs-on: ubuntu-latest | |
| needs: detect-secrets | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Setup JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'semeru' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v3 | |
| with: | |
| gradle-version: 9.0.0 | |
| cache-disabled: true | |
| - name: Generate typescript openapi client using Gradle | |
| run: | | |
| set -o pipefail | |
| gradle generateTypeScriptClient --info \ | |
| --no-daemon --console plain \ | |
| -PsourceMaven=https://development.galasa.dev/main/maven-repo/obr 2>&1 | tee build.log | |
| - name: Upload Gradle build log | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: gradle-build-log | |
| path: build.log | |
| retention-days: 7 | |
| - name: Fix openapi client | |
| run: | | |
| mkdir -p temp && | |
| promiseApiFile="galasa-ui/src/generated/galasaapi/types/PromiseAPI.ts" && | |
| cat ${promiseApiFile} | sed "s/const result =/const apiResult =/g" > temp/PromiseAPI-temp.ts && | |
| cat temp/PromiseAPI-temp.ts | sed "s/return result\.toPromise/return apiResult\.toPromise/g" > temp/PromiseAPI.ts && | |
| cp temp/PromiseAPI.ts ${promiseApiFile} && | |
| indexFile="galasa-ui/src/generated/galasaapi/index.ts" && | |
| cat ${indexFile} | sed "s/export { Configuration/export { type Configuration/1" > temp/index-temp.ts && | |
| cat temp/index-temp.ts | sed "s/export { PromiseMiddleware/export { type PromiseMiddleware/1" > temp/index.ts && | |
| cp temp/index.ts ${indexFile} | |
| - name: Fix module format in generated package.json | |
| run: | | |
| generatedPackageJson="galasa-ui/src/generated/galasaapi/package.json" | |
| if [ -f "${generatedPackageJson}" ]; then | |
| sed -i 's/"type": "commonjs"/"type": "module"/g' "${generatedPackageJson}" | |
| echo "Module format fixed in generated package.json" | |
| fi | |
| - name: Setup Nodejs | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: "24.11.0" | |
| - name: Installing webui's dependencies using npm | |
| working-directory: ./galasa-ui | |
| run: | | |
| npm install | |
| - name: Running webui's unit tests using npm | |
| working-directory: ./galasa-ui | |
| run: | | |
| npm test -- --watchAll=false | |
| - name: Building webui using npm | |
| working-directory: ./galasa-ui | |
| run: | | |
| npm run build | |
| - name: Build Webui image for testing | |
| id: build | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: dockerfiles/dockerfile.webui | |
| push: false | |
| tags: webui:test |