-
Notifications
You must be signed in to change notification settings - Fork 35
61 lines (52 loc) · 2.06 KB
/
ci.yaml
File metadata and controls
61 lines (52 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
name: CI
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
workflow_dispatch:
permissions:
# need permission to write to checks in order for spotbugs to upload check info
checks: write
contents: read
env:
MAVEN_VERSION: 3.9.15
jobs:
build_and_test:
# only run from main repo (i.e. not forks)
if: github.repository == github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '21'
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
mvn spotbugs:spotbugs -Dspotbugs.xmlOutput=true -Dspotbugs.failOnError=false
- name: Upload spotbugs
# only run for PRs
if: github.event_name == 'pull_request'
uses: lcollins/spotbugs-github-action@v3.2.0
with:
path: '**/spotbugsXml.xml'