aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/maven.yml
blob: 93da5164ea855b5dcb21d97c590138d383eae53b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Build AspectJ

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]
  workflow_dispatch:

jobs:
  build:
    # No automatic builds for Dependabot PRs
    # Caveat: cannot start 'if:' expression with '!', hence '!= true'
    if: startsWith(github.actor, 'dependabot') != true

    strategy:
      fail-fast: false
      matrix:
        # TODO: switch from 18-ea to 18, as soon as Temurin offers the download on https://adoptium.net/releases.html
        java: [ 11, 17, 18-ea ]

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - name: Set up JDK ${{ matrix.java }}
        uses: actions/setup-java@v3
        with:
          java-version: ${{ matrix.java }}
          distribution: temurin

      - name: Print tool versions
        run: |
          java -version
          ./mvnw -B --version
          ant -version

      - name: Set up cache for ~./m2/repository
        uses: actions/cache@v3
        with:
          path: |
            ~/.m2/repository
            !~/.m2/repository/org/aspectj
          key: maven-${{ runner.os }}-java-${{ matrix.java }}-${{ hashFiles('**/pom.xml') }}
          restore-keys: |
            maven-${{ runner.os }}-java-${{ matrix.java }}-
            maven-${{ runner.os }}-
            maven-

      - name: Compile + package code
        run: ./mvnw -B --file pom.xml -DskipTests package

      - name: Run Tests
        # Tests in module ajde call Swing/AWT classes. Without frame buffer they throw
        # HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it.
        uses: GabrielBB/xvfb-action@v1
        with:
          run: ./mvnw -B --file pom.xml -Daspectj.tests.verbose=false verify