Updating various data files in MegaMek and MegaMekLab #303
This file contains 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
# Validates Boards | |
# | |
# Jobs: | |
# - board_validator: Validate boards in MM | |
name: Validate Boards | |
# This Action Definition should be triggered only on master being updated or Pull Requests being added or updated against master. | |
on: | |
push: | |
branches: [ master ] | |
paths: | |
# This set of paths is the reasonable set which | |
# should trigger a validation of the boards in MM. | |
# If any changes are made to Board that use | |
# a new class, update these blocks. | |
- '**.board' | |
- 'megamek/src/megamek/common/Board.java' | |
- 'megamek/src/megamek/common/Building.java' | |
- 'megamek/src/megamek/common/Terrains.java' | |
- 'megamek/src/megamek/utilities/BoardsValidator.java' | |
pull_request: | |
branches: [ master ] | |
paths: | |
- '**.board' | |
- 'megamek/src/megamek/common/Board.java' | |
- 'megamek/src/megamek/common/Building.java' | |
- 'megamek/src/megamek/common/Terrains.java' | |
- 'megamek/src/megamek/utilities/BoardsValidator.java' | |
jobs: | |
board_validator: | |
runs-on: ${{ matrix.os }} | |
# Run this job once for each combination in the matrix below. | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] # For Board Validation running on *nix is sufficient | |
java-distribution: [ temurin ] | |
java-version: [ 17 ] | |
steps: | |
- uses: actions/checkout@v3 | |
# Setup the requested Java Distribution and Version from the matrix | |
- name: Set up ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }} | |
uses: actions/setup-java@v3 | |
with: | |
distribution: ${{ matrix.java-distribution }} | |
java-version: ${{ matrix.java-version }} | |
# Make sure we can execute the Gradle wrapper | |
- name: Grant execute permission for gradlew (*nix or MacOS) | |
run: chmod +x gradlew | |
if: runner.os != 'Windows' | |
# Build the MegaMek project | |
- name: Create MM Jar | |
run: ./gradlew jar --stacktrace | |
# Run the Boards Validator | |
- name: Validate Boards | |
working-directory: megamek | |
# Runs the BoardsValidator in default mode, which rips through | |
# the ./data directory of the current working directory. | |
# | |
# The -q flag tells the validator to only print the filenames that are invalid. | |
run: java -cp build/libs/MegaMek.jar megamek.utilities.BoardsValidator -q |