Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] Extend GH workflow matrix for jdkVersion and targetPlatform #2618

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@ on:
jobs:
build:
if: github.event_name != 'pull_request' || github.event.pull_request.base.repo.clone_url != github.event.pull_request.head.repo.clone_url
name: ${{ matrix.os }}, Java-${{ matrix.jdkVersion }}, Eclipse ${{ matrix.targetPlatform }}
strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest' ] # 'windows-latest' too flaky
os: ['ubuntu', 'macos' ] # 'windows-latest' too flaky
jdkVersion: ['11', '17']
targetPlatform: ['r202203', 'latest'] # Only test latest and earliest platform
exclude: # Since Eclipse 2023-06 Java17 is required
- jdkVersion: 11
targetPlatform: latest
fail-fast: false
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os }}-latest

steps:
- name: 'Check out repository'
Expand All @@ -24,7 +30,9 @@ jobs:
- name: 'Set up Java'
uses: actions/setup-java@v3
with:
java-version: 17
java-version: |
11
17
distribution: 'temurin'

- name: 'Cache Maven packages'
Expand All @@ -37,7 +45,8 @@ jobs:
- name: Build and test
uses: coactions/setup-xvfb@v1
with:
run: mvn clean verify -PuseJenkinsSnapshots
run: "mvn clean verify --batch-mode --toolchains ../releng/toolchains.xml -PuseJenkinsSnapshots,strict-release-jdk \
-Dtoolchain.jdk=${{ matrix.jdkVersion }} -Dtarget-platform-classifier=xtext-${{ matrix.targetPlatform }}"
working-directory: org.eclipse.xtext.full.releng

build-maven-artifacts:
Expand All @@ -62,5 +71,5 @@ jobs:
restore-keys: ${{ runner.os }}-maven

- name: Build Maven artifacts
run: mvn clean verify -PuseJenkinsSnapshots
run: mvn clean verify --batch-mode -PuseJenkinsSnapshots
working-directory: org.eclipse.xtext.maven.releng
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pipeline {
xvnc(useXauthority: true) {
sh """
./full-build.sh --tp=${selectedTargetPlatform()} \
${javaVersion() == 17 ? '' : '--toolchains releng/toolchains.xml -Pstrict-release-jdk'}
--toolchains releng/toolchains.xml -Pstrict-release-jdk -Dtoolchain.jdk=${javaVersion()}
"""
}
}// END steps
Expand Down
6 changes: 5 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,10 @@
</profile>
<profile>
<id>strict-release-jdk</id>
<properties>
<!-- By default use running java version in test runtimes-->
<toolchain.jdk>${maven.compiler.release}</toolchain.jdk>
</properties>
<build>
<plugins>
<plugin>
Expand All @@ -419,7 +423,7 @@
<toolchains>
<jdk>
<!-- Toolchain selected by maven/tycho-compiler for compilation and maven/tycho-surefire as JRE of launched test-runtimes-->
<version>${maven.compiler.release}</version>
<version>${toolchain.jdk}</version>
</jdk>
</toolchains>
</configuration>
Expand Down