Skip to content

Commit 3a5e197

Browse files
committed
Disabled Checkstyle on Tests
Enabled Checkstyle checkouts for Data, MM, MML, and MHQ.
1 parent 8e077f0 commit 3a5e197

File tree

2 files changed

+63
-4
lines changed

2 files changed

+63
-4
lines changed

.github/workflows/checkstyle.yml

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@ on:
55
branches: [ main ]
66

77
jobs:
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

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
124124
- name: Test All
125125
working-directory: mekhq
126-
run: ./gradlew testAll --stacktrace --scan -i --continue
126+
run: ./gradlew testAll --stacktrace --scan -i --continue -x checkstyleMain -x checkstyleTest
127127
env:
128128
mm.profile: dev
129129

0 commit comments

Comments
 (0)