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

JBIDE-28870: update GH action workflow #2104

Closed
wants to merge 14 commits into from
Closed
46 changes: 25 additions & 21 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,53 @@ jobs:

strategy:
matrix:
os: [ubuntu-latest]
java: ["17"]
os: [ ubuntu-latest, macos-latest, windows-latest ]
java: [ 17, 18, 19, 20, 21 ]
fail-fast: false

steps:
- name: Checkout PR branch
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

# Checkout global JBT settings.xml
- name: Checkout JBoss Tools Build CI
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: jbosstools/jbosstools-build-ci
path: build-ci

# Java JDK 11 used for maven build
# Java JDK used for maven build
- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
architecture: x64

# Try to find and apply jbosstools cache
- name: Cache local Maven repository for JBoss Tools components
uses: actions/cache@v2
distribution: 'temurin'
cache: 'maven'
# Install Maven 3.9
- name: Set up Maven
uses: stCarolas/setup-maven@07fbbe97d97ef44336b7382563d66743297e442f #v4.5
with:
path: ~/.m2/repository
key: jbosstools-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
jbosstools-${{ runner.os }}-maven-
maven-version: 3.9.4

# Build and compile using Maven
- name: Build/Compile and run unit tests
uses: GabrielBB/xvfb-action@86d97bde4a65fe9b290c0b3fb92c2c4ed0e5302d #v1
with:
run: mvn clean verify -U -fae -B --settings build-ci/maven-settings.xml -DskipITests=true -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true -ntp
- name: Build/Compile and run unit tests (Linux)
run: xvfb-run -a mvn clean verify -U -fae -B --settings build-ci/maven-settings.xml -DskipITests=true -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true -ntp
if: ${{ matrix.os == 'ubuntu-latest' }}
- name: Build/Compile and run unit tests (Mac)
run: mvn clean verify -U -fae -B --settings build-ci/maven-settings.xml -DskipITests=true -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true -ntp
if: ${{ matrix.os == 'macos-latest' }}
# as below, do fail builds on errors
- name: Build/Compile and run unit tests (Windows)
run: mvn clean verify --% -U -fae -B --settings build-ci/maven-settings.xml -fae -DskipITests=true -ntp
if: ${{ matrix.os == 'windows-latest' }}

# Archive artifacts to be applied in Publish Reports workflow
- name: Archiving test artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: ${{ matrix.os != 'windows-latest'}} # currently disabled because of https://github.com/actions/upload-artifact/issues/240
with:
name: ${{ matrix.os }}-${{ matrix.java }}-test-reports
path: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/github-script@v3.1.0
uses: actions/github-script@v6
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;

import static org.eclipse.core.runtime.Platform.OS_WIN32;

import java.io.File;
import java.io.IOException;
import java.net.URL;

import org.apache.commons.io.FileUtils;
import org.eclipse.core.runtime.Platform;
import org.jboss.tools.common.util.DownloadHelper;
import org.jboss.tools.openshift.internal.test.OpenShiftTestActivator;
import org.jboss.tools.openshift.internal.ui.utils.DownloadHelper;
import org.junit.AfterClass;
Expand Down Expand Up @@ -49,7 +53,8 @@ public void testThatODOisDownloaded() throws IOException {
assertNotNull(url);
String cmd = helper.downloadIfRequired("odo", url);
assertNotNull(cmd);
String fullProgramExe = OS_WIN32.equals(Platform.getOS())? "odo.exe":"odo";
assertEquals(ODO_CACHE_DIR + File.separatorChar + "cache" + File.separatorChar + "1.0.2" + File.separatorChar
+ "odo", cmd);
+ fullProgramExe, cmd);
}
}
Loading