|
| 1 | +name: Check Supported Java Versions |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - master |
| 6 | + |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + name: Build on JDK ${{ matrix.java }} and ${{ matrix.os }} |
| 10 | + runs-on: ${{ matrix.os }} |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + java: [8, 11] |
| 14 | + os: [ubuntu-latest] |
| 15 | + include: |
| 16 | + - java: 8 |
| 17 | + os: windows-latest |
| 18 | + - java: 13 |
| 19 | + os: ubuntu-latest |
| 20 | + # Need to update to Gradle version with v13 support in modules/openapi-generator-gradle-plugin/pom.xml |
| 21 | + flags: -am -pl modules/openapi-generator-cli |
| 22 | + steps: |
| 23 | + - name: Check out code |
| 24 | + uses: actions/checkout@v2 |
| 25 | + |
| 26 | + - name: Set up JDK ${{ matrix.java }} |
| 27 | + uses: actions/setup-java@v1 |
| 28 | + with: |
| 29 | + java-version: ${{ matrix.java }} |
| 30 | + |
| 31 | + - uses: actions/cache@v1 |
| 32 | + with: |
| 33 | + path: ~/.m2/repository |
| 34 | + key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml', 'modules/**/pom.xml') }} |
| 35 | + restore-keys: | |
| 36 | + ${{ runner.os }}-maven- |
| 37 | +
|
| 38 | + - uses: actions/cache@v2 |
| 39 | + with: |
| 40 | + path: | |
| 41 | + ~/.gradle/caches |
| 42 | + ~/.gradle/wrapper |
| 43 | + key: ${{ runner.os }}-gradle-${{ hashFiles('modules/openapi-generator-gradle-plugin/pom.xml') }} |
| 44 | + restore-keys: | |
| 45 | + ${{ runner.os }}-gradle- |
| 46 | +
|
| 47 | + - name: Build with Maven |
| 48 | + shell: bash |
| 49 | + run: mvn -nsu -B --quiet -Djacoco.skip=true -Dorg.slf4j.simpleLogger.defaultLogLevel=error --no-transfer-progress clean install --file pom.xml ${{ matrix.flags }} |
| 50 | + |
| 51 | + - name: Test gradle |
| 52 | + shell: bash |
| 53 | + run: gradle -b modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle buildGoSdk --stacktrace |
| 54 | + |
| 55 | + - name: Upload Maven build artifact |
| 56 | + uses: actions/upload-artifact@v1 |
| 57 | + if: matrix.java == '8' |
| 58 | + with: |
| 59 | + name: artifact |
| 60 | + path: modules/openapi-generator-cli/target/openapi-generator-cli.jar |
| 61 | + |
| 62 | + verify: |
| 63 | + name: Verifies integrity of the commit on ${{ matrix.os }} |
| 64 | + needs: build |
| 65 | + runs-on: ${{ matrix.os }} |
| 66 | + strategy: |
| 67 | + matrix: |
| 68 | + os: [ubuntu-latest, windows-latest] |
| 69 | + steps: |
| 70 | + - name: Check out code |
| 71 | + uses: actions/checkout@v2 |
| 72 | + - name: Download build artifact |
| 73 | + uses: actions/download-artifact@v1 |
| 74 | + with: |
| 75 | + name: artifact |
| 76 | + - name: Run Ensures Script |
| 77 | + run: | |
| 78 | + mkdir -p modules/openapi-generator-cli/target/ |
| 79 | + mv artifact/openapi-generator-cli.jar modules/openapi-generator-cli/target/ |
| 80 | + ./bin/utils/ensure-up-to-date |
0 commit comments