diff --git a/.github/actions/action.yml b/.github/actions/action.yml new file mode 100644 index 0000000000..7c91a9f5cc --- /dev/null +++ b/.github/actions/action.yml @@ -0,0 +1,29 @@ +name: 'Swagger Parser CLI' +description: 'Uses swagger parser CLI to allow validation of a definition' +inputs: + spec-file: + description: 'file of the openapi definition' + required: true + default: 'modules/swagger-parser-cli/target/test-classes/fileWithNoErrorMessages.yaml' + +runs: + using: "composite" + steps: + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '11' + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Build with Maven + run: | + mvn --no-transfer-progress -B install --file pom.xml + shell: bash + - name: Execute Jar + run: java -jar modules/swagger-parser-cli/target/swagger-parser-cli.jar ${{ inputs.inputSpec }} + shell: bash \ No newline at end of file diff --git a/.github/workflows/validate-workflow.yml b/.github/workflows/validate-workflow.yml new file mode 100644 index 0000000000..5d08179c36 --- /dev/null +++ b/.github/workflows/validate-workflow.yml @@ -0,0 +1,15 @@ +name: SwaggerParserCLI Test + +on: [push] + +jobs: + validate_job: + runs-on: ubuntu-latest + name: A job to validate a definition + steps: + - uses: actions/checkout@v3 + with: + ref: action + - uses: ./.github/actions/ + with: + inputSpec: 'modules/swagger-parser-cli/target/test-classes/fileWithValidationErrorMessages.yaml' diff --git a/modules/swagger-parser-cli/pom.xml b/modules/swagger-parser-cli/pom.xml index 6dc74a4333..2d46316436 100644 --- a/modules/swagger-parser-cli/pom.xml +++ b/modules/swagger-parser-cli/pom.xml @@ -26,6 +26,17 @@ + + org.apache.maven.plugins + maven-jar-plugin + + + + io.swagger.v3.parser.SwaggerParser + + + + org.apache.maven.plugins maven-shade-plugin