|
| 1 | +# run java client tests with petstore server |
| 2 | +name: Samples Java Petsore Client JDK11 |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + paths: |
| 7 | + - samples/client/petstore/java/jersey2-java8/** |
| 8 | + - samples/openapi3/client/petstore/java/jersey2-java8/** |
| 9 | + - samples/client/petstore/java/jersey3/** |
| 10 | + - samples/client/petstore/java/okhttp-gson/** |
| 11 | + - samples/client/petstore/java/okhttp-gson-3.1/** |
| 12 | + - samples/client/petstore/java/okhttp-gson-dynamicOperations/** |
| 13 | + - samples/client/petstore/java-micronaut-client/** |
| 14 | + pull_request: |
| 15 | + paths: |
| 16 | + - samples/client/petstore/java/jersey2-java8/** |
| 17 | + - samples/openapi3/client/petstore/java/jersey2-java8/** |
| 18 | + - samples/client/petstore/java/jersey3/** |
| 19 | + - samples/client/petstore/java/okhttp-gson/** |
| 20 | + - samples/client/petstore/java/okhttp-gson-3.1/** |
| 21 | + - samples/client/petstore/java/okhttp-gson-dynamicOperations/** |
| 22 | + - samples/client/petstore/java-micronaut-client/** |
| 23 | +jobs: |
| 24 | + build: |
| 25 | + name: Build Java Client JDK11 |
| 26 | + runs-on: ubuntu-latest |
| 27 | + strategy: |
| 28 | + fail-fast: false |
| 29 | + matrix: |
| 30 | + sample: |
| 31 | + - samples/client/petstore/java/jersey2-java8 |
| 32 | + - samples/openapi3/client/petstore/java/jersey2-java8 |
| 33 | + - samples/client/petstore/java/jersey3 |
| 34 | + - samples/client/petstore/java/okhttp-gson |
| 35 | + - samples/client/petstore/java/okhttp-gson-3.1 |
| 36 | + - samples/client/petstore/java/okhttp-gson-dynamicOperations |
| 37 | + - samples/client/petstore/java-micronaut-client |
| 38 | + services: |
| 39 | + petstore-api: |
| 40 | + image: swaggerapi/petstore |
| 41 | + ports: |
| 42 | + - 80:8080 |
| 43 | + env: |
| 44 | + SWAGGER_HOST: http://petstore.swagger.io |
| 45 | + SWAGGER_BASE_PATH: /v2 |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v5 |
| 48 | + - name: Add hosts to /etc/hosts |
| 49 | + run: | |
| 50 | + sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts |
| 51 | + - uses: actions/setup-java@v5 |
| 52 | + with: |
| 53 | + distribution: 'temurin' |
| 54 | + java-version: 11 |
| 55 | + - name: Cache maven dependencies |
| 56 | + uses: actions/cache@v4 |
| 57 | + env: |
| 58 | + cache-name: maven-repository |
| 59 | + with: |
| 60 | + path: | |
| 61 | + ~/.m2 |
| 62 | + key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} |
| 63 | + - name: Build with Maven |
| 64 | + working-directory: ${{ matrix.sample }} |
| 65 | + run: mvn clean package --no-transfer-progress |
0 commit comments