Skip to content

Commit

Permalink
added gh actions for spring generator
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoMario committed Feb 25, 2022
1 parent c4be7b3 commit 15843e1
Show file tree
Hide file tree
Showing 6 changed files with 984 additions and 0 deletions.
153 changes: 153 additions & 0 deletions .github/workflows/test-framework-v3-spring-mvc-java11.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
name: Test Framework V3 Spring MVC Java11

on:
# execute on demand
workflow_dispatch:
branches: ["3.0.0"]

jobs:

# builds codegen cli and uploads its artifact
build-codegen:

runs-on: ubuntu-latest

strategy:
matrix:
java: [ 8 ]

steps:
- uses: actions/checkout@v2
with:
ref: 3.0.0
- uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: build codegen
run: |
mkdir codegen-cli
echo "BUILDING 3.0.0"
mvn -version
mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3
cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli
- name: upload codegen cli
uses: actions/upload-artifact@v2
with:
name: codegen-cli
path: codegen-cli

generate:

needs: build-codegen

runs-on: ubuntu-latest

strategy:
matrix:
java: [ 8 ]


outputs:
generate_outcome: ${{ steps.outcome.outputs.generate_outcome }}

steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Download codegen cli
uses: actions/download-artifact@v2
with:
name: codegen-cli
- name: generate
id: generate
continue-on-error: true
uses: ./.github/actions/generate
with:
language: java
job-name: ${{ env.JOB_NAME }}
spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/3.0.0/modules/swagger-codegen/src/test/resources/3_0_0/petstore-with-issue-cases.yaml
options: --library spring-mvc -Djava11=true
- id: outcome
run: |
echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}"
echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }}
- name: upload generate outcome
uses: actions/upload-artifact@v2
with:
name: ${{ env.JOB_NAME }}generate_outcome
path: generate_outcome_${{ env.JOB_NAME }}
- name: upload generate logs
uses: actions/upload-artifact@v2
with:
name: ${{ env.JOB_NAME }}generate_logs
path: ${{ steps.generate.outputs.logs }}
- name: upload generated code
if: contains(steps.generate.outcome, 'success')
uses: actions/upload-artifact@v2
with:
name: ${{ env.JOB_NAME }}generated
path: ${{ steps.generate.outputs.path }}
env:
JOB_NAME: "spring-mvc-v3-sample"

build:

needs: generate
if: contains(needs.generate.outputs.generate_outcome, 'success')
runs-on: ubuntu-latest

strategy:
###############################################
##### DYNAMIC: Dependent on build environment
###############################################
matrix:
java-version: [1.8]
###############################################
##### END DYNAMIC: Dependent on build environment
###############################################
steps:
- uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: ${{ env.JOB_NAME }}generated
path: generated/${{ env.JOB_NAME }}
- name: Download logs
uses: actions/download-artifact@v2
with:
name: ${{ env.JOB_NAME }}generate_logs
###############################################
##### DYNAMIC: Dependent on build environment
###############################################
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java-version }}
###############################################
##### END DYNAMIC: Dependent on build environment
###############################################
- name: build
id: build
uses: ./.github/actions/build
continue-on-error: true
with:
path: generated/${{ env.JOB_NAME }}
job-name: ${{ env.JOB_NAME }}
build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3"
- id: outcome
run: |
echo "::set-output name=build_outcome::${{ steps.build.outcome }}"
echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome
- name: upload build outcome
uses: actions/upload-artifact@v2
with:
name: ${{ env.JOB_NAME }}build_outcome
path: ${{ env.JOB_NAME }}build_outcome
- name: upload logs
uses: actions/upload-artifact@v2
with:
name: ${{ env.JOB_NAME }}logs
path: ${{ steps.build.outputs.logs }}
env:
JOB_NAME: "spring-mvc-v3-sample"
153 changes: 153 additions & 0 deletions .github/workflows/test-framework-v3-spring-mvc-java8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
name: Test Framework V3 Spring MVC Java8

on:
# execute on demand
workflow_dispatch:
branches: ["3.0.0"]

jobs:

# builds codegen cli and uploads its artifact
build-codegen:

runs-on: ubuntu-latest

strategy:
matrix:
java: [ 8 ]

steps:
- uses: actions/checkout@v2
with:
ref: 3.0.0
- uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: build codegen
run: |
mkdir codegen-cli
echo "BUILDING 3.0.0"
mvn -version
mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3
cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli
- name: upload codegen cli
uses: actions/upload-artifact@v2
with:
name: codegen-cli
path: codegen-cli

generate:

needs: build-codegen

runs-on: ubuntu-latest

strategy:
matrix:
java: [ 8 ]


outputs:
generate_outcome: ${{ steps.outcome.outputs.generate_outcome }}

steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Download codegen cli
uses: actions/download-artifact@v2
with:
name: codegen-cli
- name: generate
id: generate
continue-on-error: true
uses: ./.github/actions/generate
with:
language: java
job-name: ${{ env.JOB_NAME }}
spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/3.0.0/modules/swagger-codegen/src/test/resources/3_0_0/petstore-with-issue-cases.yaml
options: --library spring-mvc -Djava8=true
- id: outcome
run: |
echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}"
echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }}
- name: upload generate outcome
uses: actions/upload-artifact@v2
with:
name: ${{ env.JOB_NAME }}generate_outcome
path: generate_outcome_${{ env.JOB_NAME }}
- name: upload generate logs
uses: actions/upload-artifact@v2
with:
name: ${{ env.JOB_NAME }}generate_logs
path: ${{ steps.generate.outputs.logs }}
- name: upload generated code
if: contains(steps.generate.outcome, 'success')
uses: actions/upload-artifact@v2
with:
name: ${{ env.JOB_NAME }}generated
path: ${{ steps.generate.outputs.path }}
env:
JOB_NAME: "spring-mvc-v3-sample"

build:

needs: generate
if: contains(needs.generate.outputs.generate_outcome, 'success')
runs-on: ubuntu-latest

strategy:
###############################################
##### DYNAMIC: Dependent on build environment
###############################################
matrix:
java-version: [1.8]
###############################################
##### END DYNAMIC: Dependent on build environment
###############################################
steps:
- uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: ${{ env.JOB_NAME }}generated
path: generated/${{ env.JOB_NAME }}
- name: Download logs
uses: actions/download-artifact@v2
with:
name: ${{ env.JOB_NAME }}generate_logs
###############################################
##### DYNAMIC: Dependent on build environment
###############################################
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java-version }}
###############################################
##### END DYNAMIC: Dependent on build environment
###############################################
- name: build
id: build
uses: ./.github/actions/build
continue-on-error: true
with:
path: generated/${{ env.JOB_NAME }}
job-name: ${{ env.JOB_NAME }}
build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3"
- id: outcome
run: |
echo "::set-output name=build_outcome::${{ steps.build.outcome }}"
echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome
- name: upload build outcome
uses: actions/upload-artifact@v2
with:
name: ${{ env.JOB_NAME }}build_outcome
path: ${{ env.JOB_NAME }}build_outcome
- name: upload logs
uses: actions/upload-artifact@v2
with:
name: ${{ env.JOB_NAME }}logs
path: ${{ steps.build.outputs.logs }}
env:
JOB_NAME: "spring-mvc-v3-sample"
Loading

0 comments on commit 15843e1

Please sign in to comment.