55 branches : [ main ]
66
77jobs :
8- pr_build :
8+ checkstyle :
99 runs-on : ${{ matrix.os }}
1010
11+ outputs :
12+ mmRepo : ${{ steps.find_mm.outputs.mmRepo }}
13+ mmBranch : ${{ steps.find_mm.outputs.mmBranch }}
14+ mmlRepo : ${{ steps.find_mml.outputs.mmRepo }}
15+ mmlBranch : ${{ steps.find_mml.outputs.mmBranch }}
16+
1117 strategy :
1218 matrix :
1319 os : [ ubuntu-latest ]
@@ -16,14 +22,67 @@ jobs:
1622 fail-fast : false
1723
1824 steps :
19- - name : " Check out MekHQ"
25+ - name : Checkout Data Repo
26+ uses : actions/checkout@v6
27+ with :
28+ repository : megamek/mm-data
29+ path : mm-data
30+
31+ - name : Checkout out MekHQ
2032 uses : actions/checkout@v6
33+ with :
34+ path : mekhq
35+
36+ - name : Find the Right MegaMek Branch
37+ id : find_mm
38+ shell : bash {0}
39+ run : |
40+ git ls-remote --exit-code --heads ${{ github.event.pull_request.head.repo.owner.html_url }}/megamek.git ${{ github.event.pull_request.head.ref }}
41+ if [ "$?" == "0" ]
42+ then
43+ echo "mmRepo=${{ github.event.pull_request.head.repo.owner.login }}/megamek" >> $GITHUB_OUTPUT
44+ echo "mmBranch=${{ github.event.pull_request.head.ref }}" >> $GITHUB_OUTPUT
45+ else
46+ echo "mmRepo=MegaMek/megamek" >> $GITHUB_OUTPUT
47+ echo "mmBranch=main" >> $GITHUB_OUTPUT
48+ fi
49+ exit 0
50+
51+ - name : Checkout MegaMek
52+ uses : actions/checkout@v6
53+ with :
54+ repository : ${{ steps.find_mm.outputs.mmRepo }}
55+ ref : ${{ steps.find_mm.outputs.mmBranch }}
56+ path : megamek
57+
58+ - name : Find the Right MegaMekLab Branch
59+ id : find_mml
60+ shell : bash {0}
61+ run : |
62+ git ls-remote --exit-code --heads ${{ github.event.pull_request.head.repo.owner.html_url }}/megameklab.git ${{ github.event.pull_request.head.ref }}
63+ if [ "$?" == "0" ]
64+ then
65+ echo "mmlRepo=${{ github.event.pull_request.head.repo.owner.login }}/megameklab" >> $GITHUB_OUTPUT
66+ echo "mmlBranch=${{ github.event.pull_request.head.ref }}" >> $GITHUB_OUTPUT
67+ else
68+ echo "mmlRepo=MegaMek/megameklab" >> $GITHUB_OUTPUT
69+ echo "mmlBranch=main" >> $GITHUB_OUTPUT
70+ fi
71+ exit 0
72+
73+ - name : Checkout MegaMekLab
74+ uses : actions/checkout@v6
75+ with :
76+ repository : ${{ steps.find_mml.outputs.mmlRepo }}
77+ ref : ${{ steps.find_mml.outputs.mmlBranch }}
78+ path : megameklab
2179
2280 - name : Setup Gradle
2381 uses : gradle/actions/setup-gradle@v5
2482
2583 - name : Checkstyle
26- run : ./gradlew checkstyleMain
84+ working-directory : mekhq
85+ run : ./gradlew checkstyleMain checkstyleTest
2786
2887 - name : Upload Test Logs on Failure
2988 uses : actions/upload-artifact@v6
0 commit comments