Added Checkstyle GitHub Actions #835
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
| name: JavaDoc Generation on PR | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| env: | |
| GRADLE_OPTS: "-Dscan.link.VCS=${{ github.event.pull_request.html_url }}" | |
| jobs: | |
| java_doc_pr: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| mmRepo: ${{ steps.find_mm.outputs.mmRepo }} | |
| mmBranch: ${{ steps.find_mm.outputs.mmBranch }} | |
| steps: | |
| - name: Checkout Data Repo | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: megamek/mm-data | |
| path: mm-data | |
| - name: Checking out MegaMekLab | |
| uses: actions/checkout@v6 | |
| with: | |
| path: megameklab | |
| - name: Find the Right MegaMek Branch | |
| id: find_mm | |
| shell: bash {0} | |
| run: | | |
| git ls-remote --exit-code --heads ${{ github.event.pull_request.head.repo.owner.html_url }}/megamek.git ${{ github.event.pull_request.head.ref }} | |
| if [ "$?" == "0" ] | |
| then | |
| echo "mmRepo=${{ github.event.pull_request.head.repo.owner.login }}/megamek" >> $GITHUB_OUTPUT | |
| echo "mmBranch=${{ github.event.pull_request.head.ref }}" >> $GITHUB_OUTPUT | |
| else | |
| echo "mmRepo=MegaMek/megamek" >> $GITHUB_OUTPUT | |
| echo "mmBranch=main" >> $GITHUB_OUTPUT | |
| fi | |
| exit 0 | |
| - name: Checkout MegaMek | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: ${{ steps.find_mm.outputs.mmRepo }} | |
| ref: ${{ steps.find_mm.outputs.mmBranch }} | |
| path: megamek | |
| - name: Set up Temurin JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| with: | |
| build-scan-publish: true | |
| build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" | |
| build-scan-terms-of-use-agree: "yes" | |
| - name: Build with Gradle | |
| working-directory: megamek | |
| run: ./gradlew javadoc |