From 5a2e362434d3b90f83f1fbcec6eed2cd5ce28174 Mon Sep 17 00:00:00 2001 From: Kevin Grigorenko Date: Wed, 22 May 2024 10:40:51 -0500 Subject: [PATCH] Add GitHub action workflow Signed-off-by: Kevin Grigorenko --- .github/workflows/simplebuild.yml | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/simplebuild.yml diff --git a/.github/workflows/simplebuild.yml b/.github/workflows/simplebuild.yml new file mode 100644 index 000000000..1230fc3e3 --- /dev/null +++ b/.github/workflows/simplebuild.yml @@ -0,0 +1,38 @@ +# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions +name: OnPush +on: [push, pull_request] +env: + MAVEN_VERSION: 3.9.6 +jobs: + build_and_test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Java + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + architecture: x64 + + # Install Apache Maven >= 3.9; otherwise, we get the error, + # "Detected Maven Version: 3.8.8 is not in the allowed range [3.9,)." + # Add Maven envars for subsequent actions: + # * PATH: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path + # * MAVEN_HOME: https://docs.github.com/en/actions/learn-github-actions/variables#passing-values-between-steps-and-jobs-in-a-workflow + - name: Install Apache Maven 3.9 + run: | + sudo apt-get update && \ + sudo apt-get install curl && \ + curl -s -L https://dlcdn.apache.org/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz | tar xzf - -C /opt/ && \ + echo "/opt/apache-maven-${MAVEN_VERSION}/bin/" >> $GITHUB_PATH && \ + echo "MAVEN_HOME=/opt/apache-maven-${MAVEN_VERSION}/bin/" >> $GITHUB_ENV + + - name: Compile and Package + # org.eclipse.mat.ui.rcp.tests fails without -Pskip-ui-tests + run: | + cd parent && \ + mvn --version && \ + mvn clean install -Pskip-ui-tests