-
Notifications
You must be signed in to change notification settings - Fork 6
72 lines (60 loc) · 2.36 KB
/
trigger-pr.yaml
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
61
62
63
64
65
66
67
68
69
70
71
72
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
name: "Pull Request validation"
on:
# Triggers the workflow on pull request events
pull_request:
workflow_dispatch: # For manual trigger
jobs:
compiling-gama-base:
name: Compiling GAMA from base branch
uses: ./.github/workflows/travis-build.yaml
with:
get_testing_compiled_archives: false
get_all_archives_for_release: false
RUN_SPOTBUGS: true
SPOTBUGS_OUTPUT_ARTIFACT_NAME: "result-spotbugs-base"
CHECKOUT_BRANCH: "2024-06"
compiling-gama-pr:
name: Compiling GAMA from PR branch
uses: ./.github/workflows/travis-build.yaml
with:
get_testing_compiled_archives: true
get_all_archives_for_release: false
RUN_SPOTBUGS: true
SPOTBUGS_OUTPUT_ARTIFACT_NAME: "result-spotbugs-pr"
testing-gama-pr:
name: Testing built GAMA
needs: compiling-gama-pr
uses: ./.github/workflows/travis-build-test.yaml
spotbugs-result:
name: Display Spotbugs results
runs-on: ubuntu-latest
needs: [compiling-gama-base, compiling-gama-pr]
steps:
- uses: actions/checkout@v4
- name: Get Spotbugs result from base branch
uses: actions/download-artifact@v4
with:
name: result-spotbugs-base
path: ${{ github.workspace }}/main
- name: Get Spotbugs result from PR branch
uses: actions/download-artifact@v4
with:
name: result-spotbugs-pr
path: ${{ github.workspace }}/pull-request
- name: Calculate diff between results
run: |
python3 -m pip install lxml
python3 $GITHUB_WORKSPACE/travis/get_spotbugs_xml_diff.py -n $GITHUB_WORKSPACE/pull-request/spotbugsXml.xml -o $GITHUB_WORKSPACE/main/spotbugsXml.xml -d $GITHUB_WORKSPACE/final-report-spotbugsXml.xml
- uses: lcollins/[email protected]
with:
path: ${{ github.workspace }}/final-report-spotbugsXml.xml
fail-on-violation: true
- uses: actions/upload-artifact@v4
with:
name: final-report-spotbugs
if-no-files-found: error
compression-level: 9
overwrite: true
path: ${{ github.workspace }}/final-report-spotbugsXml.xml