Build workflow tweaks: #2
Workflow file for this run
This file contains hidden or 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
| # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions | |
| name: CI | |
| on: | |
| push: | |
| branches: | |
| pull_request: | |
| branches: | |
| workflow_dispatch: | |
| env: | |
| MAVEN_VERSION: 3.9.12 | |
| 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: | | |
| 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 | |
| mvn install -Pskip-ui-tests spotbugs:spotbugs | |
| - name: Upload spotbugs | |
| uses: lcollins/spotbugs-github-action@v3.2.0 | |
| if: github.event_name == 'pull_request' | |
| with: | |
| path: '**/spotbugsXml.xml' | |