-
Notifications
You must be signed in to change notification settings - Fork 86
109 lines (92 loc) · 3.81 KB
/
maven.yml
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# 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
#
# Suppress Maven download messages by "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn",
# see https://blogs.itemis.com/en/in-a-nutshell-removing-artifact-messages-from-maven-log-output.
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:
# AspectJ_JDK_Update
# Check for available Temurin releases on https://adoptium.net/releases.html
java: [ 17, 21 ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
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@v4
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
# Also install (not just package) for subsequent build steps
run: ./mvnw -B --file pom.xml -DskipTests install "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
- name: Attach aspectjrt to build
uses: actions/upload-artifact@v4
with:
name: aspectjrt-java${{ matrix.java }}
# Binary, source, javadoc JARs + flattened POM
path: |
aspectjrt/target/aspectjrt-*.jar
aspectjrt/target/flattened-pom.xml
- name: Attach aspectjweaver to build
uses: actions/upload-artifact@v4
with:
name: aspectjweaver-java${{ matrix.java }}
# Binary, source, javadoc JARs + flattened POM
path: |
aspectjweaver/target/aspectjweaver-*.jar
aspectjweaver/target/flattened-pom.xml
- name: Attach aspectjtools to build
uses: actions/upload-artifact@v4
with:
name: aspectjtools-java${{ matrix.java }}
# Binary, source, javadoc JARs + flattened POM
path: |
aspectjtools/target/aspectjtools-*.jar
aspectjtools/target/flattened-pom.xml
- name: Attach installer to build
uses: actions/upload-artifact@v4
with:
name: installer-java${{ matrix.java }}
# Installer JAR + flattened POM
path: |
installer/target/aspectj-*.jar
installer/target/flattened-pom.xml
- name: Create docs
run: ./mvnw -B --file pom.xml -DskipTests package -pl docs -P create-docs "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
- name: Attach docs to build
uses: actions/upload-artifact@v4
with:
name: aspectj-docs-java${{ matrix.java }}
# Re-zip docs directory instead of wrapping existing distribution archive into another zip archive
path: aj-build/dist/docs/
- name: Run Tests
run: ./mvnw -B --file pom.xml -Daspectj.tests.verbose=false verify "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"