Skip to content

Commit

Permalink
Update workflow for maven based exec
Browse files Browse the repository at this point in the history
  • Loading branch information
sfuhrm committed Oct 27, 2023
1 parent 442894a commit a7ff3bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 36 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/generate-code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,19 @@ jobs:

- uses: actions/checkout@v3

- name: Install xmlstarlet for pom.xml manipulation
run: sudo apt-get install -y xmlstarlet

- name: Download OpenAPI spec from above job
uses: actions/download-artifact@v3
with:
name: ${{ inputs.source_artifact }}

- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Create code based on OpenAPI spec
run: ./generate.sh
env:
Expand All @@ -42,5 +47,4 @@ jobs:
with:
name: ${{ inputs.target_artifact }}
path: |
src
pom.xml
.
32 changes: 1 addition & 31 deletions .github/workflows/generate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,7 @@ jobs:
with:
cmk_version: 2.2.0p12
source_artifact: openapi
target_artifact: source

build:
runs-on: ubuntu-latest
needs: generate-code
strategy:
matrix:
java: [ 8, 11, 17, 21 ]
steps:

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'

- name: Download source
uses: actions/download-artifact@v3
with:
name: source

- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn -B package --file pom.xml
target_artifact: build

deploy-snapshot:
runs-on: ubuntu-latest
Expand Down

0 comments on commit a7ff3bf

Please sign in to comment.