build.yml 992 B

123456789101112131415161718192021222324252627282930313233343536
  1. name: Build
  2. on:
  3. push:
  4. env:
  5. JAVA_VERSION: 17
  6. defaults:
  7. run:
  8. shell: bash
  9. jobs:
  10. test:
  11. name: Compile and Test
  12. runs-on: ubuntu-latest
  13. if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
  14. steps:
  15. - uses: actions/checkout@v2
  16. - uses: actions/setup-java@v1
  17. with:
  18. java-version: ${{ env.JAVA_VERSION }}
  19. - uses: actions/cache@v2
  20. with:
  21. path: ~/.m2/repository
  22. key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
  23. restore-keys: |
  24. ${{ runner.os }}-maven-
  25. - name: Build and Test
  26. run: mvn -B clean install jacoco:report -Pcoverage,dependency-check
  27. - name: Upload code coverage report
  28. id: codacyCoverageReporter
  29. run: bash <(curl -Ls https://coverage.codacy.com/get.sh)
  30. env:
  31. CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
  32. continue-on-error: true