niklas2810/my-discord-butler

View on GitHub
.github/workflows/test.yml

Summary

Maintainability
Test Coverage
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Unit Testing

on:
  push:
    branches-ignore:
      - main
    paths:
      - 'src/**'
      - '**.xml'
      - '**.yml'
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: ⏬ Checkout code
        uses: actions/checkout@v2
      - name: ⚙️ Set up JDK 14
        uses: actions/setup-java@v1
        with:
          java-version: 14
      - name: 💽 Restore Maven cache
        uses: actions/cache@v2
        with:
          path: ~/.m2/repository
          key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
          restore-keys: |
            maven-${{ runner.os }}-
      - name: 🧪 Run Unit Tests
        run: mvn test