This repository has been archived by the owner on Nov 11, 2024. It is now read-only.
Update messages to be errors #176
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
# | |
# Copyright contributors to the Galasa project | |
# | |
# SPDX-License-Identifier: EPL-2.0 | |
# | |
name: PR build | |
on: | |
pull_request: | |
branches: [main] | |
env: | |
REGISTRY: ghcr.io | |
NAMESPACE: galasa-dev | |
jobs: | |
build-framework: | |
name: Build Framework using openapi2beans and gradle | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'semeru' | |
- name: Print githash | |
run: | | |
echo $GITHUB_SHA > ./framework.githash | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
gradle-version: 8.9 | |
cache-disabled: true | |
- name: Build servlet beans with openapi2beans | |
run: | | |
docker run --rm -v ${{ github.workspace }}:/var/workspace ghcr.io/galasa-dev/openapi2beans:main generate --yaml var/workspace/${{ env.YAML_LOCATION }} --output var/workspace/${{ env.OUTPUT_LOCATION }} --package ${{ env.PACKAGE }} | |
env: | |
YAML_LOCATION: "galasa-parent/dev.galasa.framework.api.openapi/src/main/resources/openapi.yaml" | |
OUTPUT_LOCATION: "galasa-parent/dev.galasa.framework.api.beans/src/main/java" | |
PACKAGE: "dev.galasa.framework.api.beans.generated" | |
- name: Build Framework source code | |
run: | | |
gradle -b galasa-parent/build.gradle check publish --info \ | |
--no-daemon --console plain \ | |
-Dorg.gradle.jvmargs=-Xmx5120M \ | |
-PsourceMaven=https://development.galasa.dev/main/maven-repo/maven/ \ | |
-PcentralMaven=https://repo.maven.apache.org/maven2/ \ | |
-PtargetMaven=${{ github.workspace }}/repo | |
- name: Upload Jacoco Reports as artifact | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: unit-tests | |
path: /home/runner/work/framework/framework/galasa-parent/**/build/reports/**/*.html | |
retention-days: 7 | |
if-no-files-found: ignore | |
- name: Build Framework image for testing | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: dockerfiles/dockerfile.framework | |
load: true | |
tags: framework:test | |
build-args: | | |
dockerRepository=ghcr.io | |
tag=main | |
build-rest-api-documentation: | |
name: Build REST API documentation using openapi2beans and gradle | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'semeru' | |
- name: Install Swagger CLI | |
run: | | |
wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.41/swagger-codegen-cli-3.0.41.jar -O swagger-codegen-cli.jar | |
- name: Generate Swagger docs | |
run: | | |
java -jar swagger-codegen-cli.jar generate -i galasa-parent/dev.galasa.framework.api.openapi/src/main/resources/openapi.yaml -l html2 -o docs/generated/galasaapi | |
- name: Build Restapidoc image for testing | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: dockerfiles/dockerfile.restapidocsite | |
load: true | |
tags: restapidoc-site:test |