Update settings.gradle #4
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
name: Game Unit Tests | |
on: [push, pull_request] # Will trigger whenever a push is made to the branch, regardless of which branch | |
jobs: | |
run_unit_tests: | |
runs-on: ubuntu-latest # Running on this OS, if we need it changed lmk | |
steps: | |
- uses: actions/checkout@v2 # Checkout repo to remote machine | |
- name: Set up OpenJDK17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: '17' | |
- name: Cache Gradle packages # Allows us to reuse packages between runs | |
uses: actions/cache@v2 # If the files specified in key change we dump old cache else re-use | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Run Unit Tests | |
id: tests # Unique ID to reference later to color our message | |
run: | | |
cd $GRADLE_DIR | |
chmod +x ./gradlew | |
./gradlew --stacktrace test | |
env: | |
GRADLE_DIR: 'source' # Modify this to wherever './gradlew' is | |
- name: Post to Slack # Notify the channel specified in the env variables | |
if: always() && github.ref == 'refs/heads/main' # Always run when on main | |
uses: rtCamp/[email protected] | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TEST }} # Same bot used for all, don't change | |
SLACK_CHANNEL: 'bot-testing' # Where are we posting to? | |
SLACK_TITLE: 'Test Results' | |
SLACK_MESSAGE: 'Unit Tests reported *${{steps.tests.conclusion}}*! Commit message: ```${{ github.event.head_commit.message }}```' | |
SLACK_COLOR: ${{ job.status }} # Automatically changes color of the message | |
SLACK_USERNAME: DECO2800 Overwatch | |
SLACK_ICON: https://static.wikia.nocookie.net/1547a0b1-0227-43c5-ac81-9f1d0895824b | |
SLACK_FOOTER: '' | |
MSG_MINIMAL: commit,actions url # We only want the commit link and actions url | |
- name: Cleanup Gradle Cache | |
if: always() | |
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. | |
# Restoring these files from a GitHub Actions cache might cause problems for future builds. | |
run: | | |
rm -f ~/.gradle/caches/modules-2/modules-2.lock | |
rm -f ~/.gradle/caches/modules-2/gc.properties |