Skip to content

Commit

Permalink
test workflow and action
Browse files Browse the repository at this point in the history
checkout version
  • Loading branch information
gracekarina committed Jul 29, 2022
1 parent 03733f8 commit 55c73aa
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/actions/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
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
- run: pwd
shell: bash
- name: Execute Jar
run: java -jar modules/swagger-parser-cli/target/swagger-parser-cli.jar ${{ inputs.inputSpec }}
shell: bash
17 changes: 17 additions & 0 deletions .github/workflows/validate-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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'
- run: echo 'Fin'
shell: bash
11 changes: 11 additions & 0 deletions modules/swagger-parser-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>io.swagger.v3.parser.SwaggerParser</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down

0 comments on commit 55c73aa

Please sign in to comment.