build.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # Automatically build the project and run any configured tests for every push
  2. # and submitted pull request. This can help catch issues that only occur on
  3. # certain platforms or Java versions, and provides a first line of defence
  4. # against bad commits.
  5. name: build
  6. on: [pull_request, push]
  7. jobs:
  8. build:
  9. strategy:
  10. matrix:
  11. # Use these Java versions
  12. java: [
  13. 16
  14. ]
  15. # and run on both Linux and Windows
  16. os: [ubuntu-20.04, windows-latest]
  17. runs-on: ${{ matrix.os }}
  18. steps:
  19. - name: checkout repository
  20. uses: actions/checkout@v2
  21. - name: validate gradle wrapper
  22. uses: gradle/wrapper-validation-action@v1
  23. - name: setup jdk ${{ matrix.java }}
  24. uses: actions/setup-java@v1
  25. with:
  26. java-version: ${{ matrix.java }}
  27. - name: make gradle wrapper executable
  28. if: ${{ runner.os != 'Windows' }}
  29. run: chmod +x ./gradlew
  30. - name: build
  31. run: ./gradlew build
  32. - name: capture build artifacts
  33. if: ${{ runner.os == 'Linux' && matrix.java == '11' }} # Only upload artifacts built from LTS java on one OS
  34. uses: actions/upload-artifact@v2
  35. with:
  36. name: Artifacts
  37. path: build/libs/