forked from MegaMek/megamek
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (59 loc) · 2.23 KB
/
validate-boards.yml
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
# 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