|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths-ignore: |
| 6 | + - 'README.md' |
| 7 | + pull_request: |
| 8 | + types: [assigned, opened, synchronize, reopened, ready_for_review, edited] |
| 9 | + paths-ignore: |
| 10 | + - 'README.md' |
| 11 | + schedule: |
| 12 | + - cron: '0 0 * * *' |
| 13 | + |
| 14 | +jobs: |
| 15 | + build-jdk11: |
| 16 | + name: "JDK 11 Build" |
| 17 | + runs-on: ubuntu-latest |
| 18 | + # Skip draft PRs and those with WIP in the subject, rerun as soon as its removed |
| 19 | + if: "github.event_name != 'pull_request' || ( \ |
| 20 | + github.event.pull_request.draft == false && \ |
| 21 | + github.event.pull_request.state != 'closed' && \ |
| 22 | + contains(github.event.pull_request.title, 'wip ') == false && \ |
| 23 | + contains(github.event.pull_request.title, '[wip]') == false && \ |
| 24 | + ( |
| 25 | + github.event.action != 'edited' || \ |
| 26 | + contains(github.event.changes.title.from, 'wip ') || \ |
| 27 | + contains(github.event.changes.title.from, '[wip]') \ |
| 28 | + ) \ |
| 29 | + )" |
| 30 | + steps: |
| 31 | + - uses: actions/checkout@v2 |
| 32 | + - uses: n1hility/cancel-previous-runs@v2 |
| 33 | + if: github.event_name == 'pull_request' |
| 34 | + with: |
| 35 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 36 | + - name: Set up JDK 11 |
| 37 | + # Uses sha for added security since tags can be updated |
| 38 | + uses: joschi/setup-jdk@b9cc6eabf7e7e3889766b5cee486f874c9e1bd2d |
| 39 | + with: |
| 40 | + java-version: 11 |
| 41 | + - name: Build with Maven and Coverage |
| 42 | + if: github.event_name == 'pull_request' |
| 43 | + run: mvn verify -P coverage |
| 44 | + - name: Build with Maven and Coverage/Sonar |
| 45 | + if: github.event_name != 'pull_request' |
| 46 | + run: mvn verify -P coverage,sonar |
| 47 | + env: |
| 48 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 49 | + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
| 50 | + - name: Codecov metrics |
| 51 | + uses: codecov/codecov-action@v1 |
| 52 | + - name: Prepare failure archive (if maven failed) |
| 53 | + if: failure() |
| 54 | + shell: bash |
| 55 | + run: find . -name '*-reports' -type d | tar -czvf test-reports.tgz -T - |
| 56 | + - name: Upload failure Archive (if maven failed) |
| 57 | + uses: actions/upload-artifact@v1 |
| 58 | + if: failure() |
| 59 | + with: |
| 60 | + name: test-reports-linux-jvm11 |
| 61 | + path: 'test-reports.tgz' |
0 commit comments