|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - 'main' |
| 7 | + paths-ignore: |
| 8 | + - '.github/**/*.md' |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - 'main' |
| 12 | + paths-ignore: |
| 13 | + - '.github/**/*.md' |
| 14 | + workflow_dispatch: |
| 15 | + |
| 16 | +jobs: |
| 17 | + build: |
| 18 | + strategy: |
| 19 | + fail-fast: false |
| 20 | + matrix: |
| 21 | + java: [ '11', '17' ] |
| 22 | + maven: [ '3.8.4'] |
| 23 | + os: [ 'ubuntu-20.04' ] |
| 24 | + name: Build (Java ${{ matrix.java }}, ${{ matrix.os }}) |
| 25 | + runs-on: ${{ matrix.os }} |
| 26 | + steps: |
| 27 | + - name: Checkout |
| 28 | + if: github.head_ref == '' |
| 29 | + uses: actions/checkout@v2 |
| 30 | + |
| 31 | + - name: Checkout merge |
| 32 | + if: github.head_ref != '' |
| 33 | + uses: actions/checkout@v2 |
| 34 | + with: |
| 35 | + ref: refs/pull/${{github.event.pull_request.number}}/merge |
| 36 | + |
| 37 | + - name: Set up Cache |
| 38 | + uses: actions/cache@v2 |
| 39 | + with: |
| 40 | + path: | |
| 41 | + ~/.m2/repository |
| 42 | + !~/.m2/repository/org/openhab |
| 43 | + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} |
| 44 | + restore-keys: | |
| 45 | + ${{ runner.os }}-maven- |
| 46 | +
|
| 47 | + - name: Set up Java ${{ matrix.java }} |
| 48 | + uses: actions/setup-java@v2 |
| 49 | + with: |
| 50 | + distribution: 'zulu' |
| 51 | + java-version: ${{ matrix.java }} |
| 52 | + |
| 53 | + - name: Set up Maven ${{ matrix.maven }} |
| 54 | + uses: stCarolas/setup-maven@v4.2 |
| 55 | + with: |
| 56 | + maven-version: ${{ matrix.maven }} |
| 57 | + |
| 58 | + - name: Build |
| 59 | + id: build |
| 60 | + run: './.github/scripts/maven-build' |
| 61 | + env: |
| 62 | + MAVEN_OPTS: >- |
| 63 | + -Xmx2g |
| 64 | + -Dmaven.wagon.http.retryHandler.count=5 |
| 65 | + -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 |
| 66 | + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn |
| 67 | +
|
| 68 | + - name: Upload Build Log |
| 69 | + if: ${{ always() && ((steps.build.outcome == 'success') || (steps.build.outcome == 'failure')) }} |
| 70 | + uses: actions/upload-artifact@v2 |
| 71 | + with: |
| 72 | + name: build-log-java-${{ matrix.java }}-${{ matrix.os }} |
| 73 | + path: build.log |
| 74 | + |
| 75 | + - name: Upload SAT Summary Report |
| 76 | + if: ${{ always() && ((steps.build.outcome == 'success') || (steps.build.outcome == 'failure')) }} |
| 77 | + uses: actions/upload-artifact@v2 |
| 78 | + with: |
| 79 | + name: sat-summary-report |
| 80 | + path: target/summary_report.html |
0 commit comments