You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

maven.yml 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. # This workflow will build a Java project with Maven
  2. # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
  3. name: Build AspectJ
  4. on:
  5. push:
  6. branches: [ master ]
  7. pull_request:
  8. branches: [ master ]
  9. workflow_dispatch:
  10. jobs:
  11. build:
  12. # No automatic builds for Dependabot PRs
  13. # Caveat: cannot start 'if:' expression with '!', hence '!= true'
  14. if: startsWith(github.actor, 'dependabot') != true
  15. strategy:
  16. fail-fast: false
  17. matrix:
  18. # Check for available Temurin releases on https://adoptium.net/releases.html
  19. java: [ 11, 17, 19 ]
  20. runs-on: ubuntu-latest
  21. steps:
  22. - uses: actions/checkout@v3
  23. - name: Set up JDK ${{ matrix.java }}
  24. uses: actions/setup-java@v3
  25. with:
  26. java-version: ${{ matrix.java }}
  27. distribution: temurin
  28. - name: Print tool versions
  29. run: |
  30. java -version
  31. ./mvnw -B --version
  32. ant -version
  33. - name: Set up cache for ~./m2/repository
  34. uses: actions/cache@v3
  35. with:
  36. path: |
  37. ~/.m2/repository
  38. !~/.m2/repository/org/aspectj
  39. key: maven-${{ runner.os }}-java-${{ matrix.java }}-${{ hashFiles('**/pom.xml') }}
  40. restore-keys: |
  41. maven-${{ runner.os }}-java-${{ matrix.java }}-
  42. maven-${{ runner.os }}-
  43. maven-
  44. - name: Compile + package code
  45. # Also install (not just package) for subsequent build steps
  46. run: ./mvnw -B --file pom.xml -DskipTests install
  47. - name: Attach aspectjrt to build
  48. uses: actions/upload-artifact@v3
  49. with:
  50. name: aspectjrt-java${{ matrix.java }}
  51. # Binary, source, javadoc JARs + flattened POM
  52. path: |
  53. aspectjrt/target/aspectjrt-*.jar
  54. aspectjrt/target/flattened-pom.xml
  55. - name: Attach aspectjweaver to build
  56. uses: actions/upload-artifact@v3
  57. with:
  58. name: aspectjweaver-java${{ matrix.java }}
  59. # Binary, source, javadoc JARs + flattened POM
  60. path: |
  61. aspectjweaver/target/aspectjweaver-*.jar
  62. aspectjweaver/target/flattened-pom.xml
  63. - name: Attach aspectjtools to build
  64. uses: actions/upload-artifact@v3
  65. with:
  66. name: aspectjtools-java${{ matrix.java }}
  67. # Binary, source, javadoc JARs + flattened POM
  68. path: |
  69. aspectjtools/target/aspectjtools-*.jar
  70. aspectjtools/target/flattened-pom.xml
  71. - name: Create docs
  72. run: ./mvnw -B --file pom.xml -DskipTests process-resources -pl docs -P create-docs
  73. - name: Attach docs to build
  74. uses: actions/upload-artifact@v3
  75. with:
  76. name: aspectj-docs-java${{ matrix.java }}
  77. # Re-zip docs directory instead of wrapping existing distribution archive into another zip archive
  78. path: aj-build/dist/docs/
  79. - name: Run Tests
  80. # Tests in module ajde call Swing/AWT classes. Without frame buffer they throw
  81. # HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it.
  82. uses: GabrielBB/xvfb-action@v1
  83. with:
  84. run: ./mvnw -B --file pom.xml -Daspectj.tests.verbose=false verify