Merge branch 'refs/heads/master' into e431 #127
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build AJDT | |
on: | |
workflow_dispatch: | |
inputs: | |
testMode: | |
type: choice | |
description: Test mode | |
required: true | |
default: 'skip tests' | |
options: | |
- 'skip tests' | |
- 'run tests' | |
- 'run more tests, fail at end' | |
- 'run all tests, ignore failures' | |
push: | |
branches: | |
- '*' | |
- '!gh-pages' | |
pull_request: | |
branches: | |
- '*' | |
- '!gh-pages' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macOS-latest ] | |
# Tycho only supports LTS, other Java releases only short-term. | |
# Tycho 3 no longer supports building on JDK 11, because it contains Java 17 class files. | |
java: [ 17 ] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Set Git options | |
# Check out as-is, commit Unix-style line endings | |
run: git config --global core.autocrlf input | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up cache for ~./m2/repository | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.m2/repository | |
!~/.m2/repository/org/eclipse/ajdt | |
!~/.m2/repository/org/aspectj/ajde | |
key: maven-${{ matrix.os }}-java${{ matrix.java }}-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
maven-${{ matrix.os }}-java${{ matrix.java }}- | |
maven-${{ matrix.os }}- | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: temurin | |
# Tycho needs Maven 3.9.0+ | |
- name: Set up Maven | |
run: | |
mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.2.0:wrapper "-Dmaven=3.9.6" | |
- name: Print tool versions | |
run: | | |
java -version | |
./mvnw --batch-mode --version | |
# Always run build without tests first | |
- name: Build + package (no tests) | |
run: ./mvnw --batch-mode -Pe431 -DskipTests clean verify | |
# Then optionally run tests in one of 3 user-selected modes | |
# TODO: find a way to avoid duplication | |
- name: Run tests normally, fail normally | |
if: ${{ github.event.inputs.testMode == 'run tests' }} | |
# UI tests need frame buffer on Linux | |
uses: GabrielBB/xvfb-action@v1 | |
with: | |
run: ./mvnw --batch-mode -Pe431 verify | |
- name: Run more tests, fail at end | |
if: ${{ github.event.inputs.testMode == 'run more tests, fail at end' }} | |
# UI tests need frame buffer on Linux | |
uses: GabrielBB/xvfb-action@v1 | |
with: | |
run: ./mvnw --batch-mode -Pe431 --fail-at-end verify | |
- name: Run all tests, ignore failures | |
if: ${{ github.event.inputs.testMode == 'run all tests, ignore failures' }} | |
# UI tests need frame buffer on Linux | |
uses: GabrielBB/xvfb-action@v1 | |
with: | |
run: ./mvnw --batch-mode -Pe431 -Dmaven.test.failure.ignore=true verify | |
# No matter if a preceding test run failed or not, try to generate and upload a test report | |
# TODO: these steps should only happen if at least the build without tests passed, not always | |
- name: Generate aggregate test report | |
if: always() | |
run: ./mvnw --batch-mode -Pe431 -Daggregate=true surefire-report:report-only | |
- name: Attach aggregate test report to build | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: surefire-report-${{ matrix.os }}-java${{ matrix.java }} | |
path: target/site/surefire-report.html |