Skip to content

Commit

Permalink
Merge branch 'MegaMek:master' into dev_Windchild_PhenotypeBonusSkillGen
Browse files Browse the repository at this point in the history
  • Loading branch information
Windchild292 authored Jan 24, 2022
2 parents 091bcb2 + c8651b9 commit 28e68e6
Show file tree
Hide file tree
Showing 7,514 changed files with 1,285,729 additions and 1,047,511 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
112 changes: 32 additions & 80 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,52 @@
#
# Builds MekHQ for CI (and CD via artifacts)
#
# Jobs:
#
# - ci_cd: Build MekHQ for CI/CD on Ubuntu with Java 11
# - This job will use MM and MML source directly
# for the build.
#
# - other_os_ci: Build MekHQ on Windows and MacOS.
# - This job runs after `ci_cd` completes successfully.
#

# - ci_cd: Build MekHQ for CI/CD on the specified Operating Systems for the specified Java versions
# - This job will use MM and MML source directly for the build.
name: MekHQ CI with Gradle

#
# This Action Definition should be triggered only on
# Pull Requests being added/updated against master.
#
on:
pull_request:
branches: [ master ]

#
# Setup the Build Scan "VCS" link for all gradle invocations
#
env:
GRADLE_OPTS: "-Dscan.link.VCS=${{ github.event.pull_request.html_url }}"

jobs:

#
# Perform CI (and CD as an artifact) of MekHQ
# any time a pull request is added or updated.
#
# Perform CI (and CD as an artifact) of MekHQ any time a pull request is added or updated.
ci_cd:

# For CI/CD running on *nix is sufficient
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}

# Run this job once for each combination in the matrix below.
strategy:
matrix:
os: [ ubuntu-latest ] # For CI/CD running on *nix is sufficient
java-distribution: [ temurin ]
java-version: [ 11 ]
fail-fast: false

steps:
#
# Checkout the Pull Request source
# and put it in: ./mekhq
#
# Checkout the Pull Request source and put it in: ./mekhq
- uses: actions/checkout@v2
with:
path: mekhq

#
# Setup composite build for MekHQ
#
# see: https://github.com/MegaMek/megamek/wiki/Working-With-Gradle
#
# See: https://github.com/MegaMek/megamek/wiki/Working-With-Gradle
- name: Setup Composite Build for MekHQ
run: |
echo "includeBuild '../megamek'" >./mekhq/settings_local.gradle
echo "includeBuild '../megameklab'" >>./mekhq/settings_local.gradle
#
# Find the repo and branch to use for MM
#
# Output variables:
#
# - mmRepo: The MM repository to use.
# - mmBranch: The MM branch to use.
#
- name: Find the Right MegaMek Branch
id: find_mm
# Override bash so that it doesn't fail fast (the default)
Expand All @@ -86,25 +68,20 @@ jobs:
fi
exit 0
#
# Checkout the latest Megamek source
# and put it in: ./megamek
#
# Checkout the latest MegaMek source and put it in: ./megamek
- name: Checkout MegaMek
uses: actions/checkout@v2
with:
repository: ${{ steps.find_mm.outputs.mmRepo }}
ref: ${{ steps.find_mm.outputs.mmBranch }}
path: megamek

#
# Find the repo and branch to use for MML
#
# Output variables:
#
# - mmlRepo: The MML repository to use.
# - mmlBranch: The MML branch to use.
#
- name: Find the Right MegaMekLab Branch
id: find_mml
# Override bash so that it doesn't fail fast (the default)
Expand All @@ -126,42 +103,33 @@ jobs:
fi
exit 0
#
# Checkout the latest MegaMekLab source
# and put it in: ./megameklab
#
# Checkout the latest MegaMekLab source and put it in: ./megameklab
- name: Checkout MegaMekLab
uses: actions/checkout@v2
with:
repository: ${{ steps.find_mml.outputs.mmlRepo }}
ref: ${{ steps.find_mml.outputs.mmlBranch }}
path: megameklab

#
# Setup composite build for MegaMekLab
#
# see: https://github.com/MegaMek/megamek/wiki/Working-With-Gradle
#
# See: https://github.com/MegaMek/megamek/wiki/Working-With-Gradle
- name: Setup Composite Build for MegaMekLab
run: |
echo "if (gradle.parent == null) includeBuild '../megamek'" >./megameklab/settings_local.gradle
#
# Use Java 11
#
- name: Set up JDK 11
uses: actions/setup-java@v1
# Setup the requested Java Distribution and Version from the matrix
- name: Set up ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }}
uses: actions/setup-java@v2
with:
java-version: 11
distribution: ${{ matrix.java-distribution }}
java-version: ${{ matrix.java-version }}

#
# Make sure we can execute the Gradle wrapper
#
# Make sure we can execute the Gradle wrapper
- name: Grant execute permission for gradlew (*nix or MacOS)
working-directory: mekhq
run: chmod +x gradlew
if: runner.os != 'Windows'

#
# Build the MekHQ project
#
# Directory layout:
Expand All @@ -172,42 +140,32 @@ jobs:
#
# Output Variables:
# - buildScanUri
#
- name: Build with Gradle
id: gradle_build
working-directory: mekhq
run: ./gradlew -I .github/build-scan-init.gradle build --stacktrace --scan

#
# If the build step fails, try to upload any
# test logs in case it was a unit test failure.
#

# If the build step fails, try to upload any test logs in case it was a unit test failure.
# The logs will be relative to the ./mekhq directory.
#
- name: Upload Test Logs on Failure
uses: actions/upload-artifact@v2-preview
uses: actions/upload-artifact@v2.2.4
if: failure()
with:
name: cd-failure-logs
path: ./mekhq/MekHQ/build/reports/

#
# Upload our Code Coverage Reports to CodeCov.io
#
- name: CodeCov.io Coverage Report
uses: codecov/codecov-action@v1
with:
directory: ./mekhq/MekHQ/build/reports/jacoco/test
fail_ci_if_error: false
verbose: true

#
# If we have a buildScanUri comment on the PR
#
# NB: This only works if you're on the main MegaMek\mekhq repo
# for now due to a GitHub Actions limitation.
#

# CAW: temporarily halted https://github.com/thollander/actions-comment-pull-request/issues/17
# - name: Comment on PR with Build Scan URI
# uses: thollander/actions-comment-pull-request@master
Expand All @@ -216,23 +174,17 @@ jobs:
# message: Build scan available at ${{ steps.gradle_build.outputs.buildScanUri }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

#
# Put the Windows Release up in an artifact
#
# NB: Due to a GitHub Actions limitation we won't know
# what the filename is in order to display it somewhere.
#
# NB: Due to a GitHub Actions limitation we won't know what the filename is in order to display it somewhere.
- name: Upload Windows Release
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v2.2.4
with:
name: release-win-java8
name: release-win-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }}
path: ./mekhq/MekHQ/build/distributions/*.zip

#
# Put the non-Windows release in an artifact
#
- name: Upload Nix/Mac Release
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v2.2.4
with:
name: release-nix-mac-java8
name: release-nix-mac-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }}
path: ./mekhq/MekHQ/build/distributions/*.tar
80 changes: 25 additions & 55 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
@@ -1,104 +1,80 @@
#
# Builds MekHQ for Code Coverage
#
# Jobs:
#
# - code_coverage: Build MekHQ on Ubuntu with Java 1.8
# - code_coverage: Build MekHQ on the specified Operating Systems for the specified Java versions
# and upload the code coverage results to CodeCov.io
# - This job will use MM and MML source directly
# for the build.
#

name: MekHQ CI with Code Coverage

#
# This Action Definition should be triggered only on pushes to master.
#
# This Action Definition should be triggered only on pushes to master
on:
push:
branches: [ master ]

#
# Setup the Build Scan "VCS" link for all gradle invocations
#
env:
GRADLE_OPTS: "-Dscan.link.VCS=https://github.com/MegaMek/mekhq/commit/${{ github.sha }}"

jobs:

#
# Perform build of MekHQ for Code Coverage
# any time master updated.
#
# Perform build of MekHQ for Code Coverage any time master updated.
code_coverage:

# For this job running on *nix is sufficient
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}

# Run this job once for each combination in the matrix below.
strategy:
matrix:
os: [ ubuntu-latest ] # For Code QL running on *nix is sufficient
java-distribution: [ temurin ]
java-version: [ 11 ]

steps:
#
# Checkout the Pull Request source
# and put it in: ./mekhq
#
# Checkout the Pull Request source and put it in: ./mekhq
- uses: actions/checkout@v2
with:
path: mekhq

#
# Setup composite build for MekHQ
#
# see: https://github.com/MegaMek/megamek/wiki/Working-With-Gradle
#
# See: https://github.com/MegaMek/megamek/wiki/Working-With-Gradle
- name: Setup Composite Build for MekHQ
run: |
echo "includeBuild '../megamek'" >./mekhq/settings_local.gradle
echo "includeBuild '../megameklab'" >>./mekhq/settings_local.gradle
#
# Checkout the latest Megamek source
# and put it in: ./megamek
#
# Checkout the latest MegaMek source and put it in: ./megamek
- name: Checkout MegaMek
uses: actions/checkout@v2
with:
repository: MegaMek/megamek
path: megamek

#
# Checkout the latest MegaMekLab source
# and put it in: ./megameklab
#
# Checkout the latest MegaMekLab source and put it in: ./megameklab
- name: Checkout MegaMekLab
uses: actions/checkout@v2
with:
repository: MegaMek/megameklab
path: megameklab

#
# Setup composite build for MegaMekLab
#
# see: https://github.com/MegaMek/megamek/wiki/Working-With-Gradle
#
# See: https://github.com/MegaMek/megamek/wiki/Working-With-Gradle
- name: Setup Composite Build for MegaMekLab
run: |
echo "if (gradle.parent == null) includeBuild '../megamek'" >./megameklab/settings_local.gradle
#
# Use Java 11
#
- name: Set up JDK 11
uses: actions/setup-java@v1
# Setup the requested Java Distribution and Version from the matrix
- name: Set up ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }}
uses: actions/setup-java@v2
with:
java-version: 11
distribution: ${{ matrix.java-distribution }}
java-version: ${{ matrix.java-version }}

#
# Make sure we can execute the Gradle wrapper
#
# Make sure we can execute the Gradle wrapper
- name: Grant execute permission for gradlew (*nix or MacOS)
working-directory: mekhq
run: chmod +x gradlew
if: runner.os != 'Windows'

#
# Build the MekHQ project
#
# Directory layout:
Expand All @@ -109,28 +85,22 @@ jobs:
#
# Output Variables:
# - buildScanUri
#
- name: Build with Gradle
id: gradle_build
working-directory: mekhq
run: ./gradlew -I .github/build-scan-init.gradle build --stacktrace --scan

#
# If the build step fails, try to upload any
# test logs in case it was a unit test failure.
# If the build step fails, try to upload any test logs in case it was a unit test failure.
#
# The logs will be relative to the ./mekhq directory.
#
- name: Upload Test Logs on Failure
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v2.2.4
if: failure()
with:
name: cd-failure-logs
path: ./mekhq/MekHQ/build/reports/

#
# Upload our Code Coverage Reports to CodeCov.io
#
- name: CodeCov.io Coverage Report
uses: codecov/codecov-action@v1
with:
Expand Down
Loading

0 comments on commit 28e68e6

Please sign in to comment.