Automation_compile #3
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: Automation_compile | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java-version: [8] # Specify the JDK version(s) here | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 # Checks out your repository | |
- name: Set up JDK ${{ matrix.java-version }} | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ matrix.java-version }} | |
distribution: 'zulu' # Or 'zulu', 'temurin', depending on your preferred JDK distribution | |
- name: Cache Maven dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Build with Maven | |
run: mvn clean compile # -B is for batch mode to reduce output noise | |
- name: Send Email Notification | |
if: always() # Run this step whether the tests succeed or fail | |
uses: dawidd6/action-send-mail@v3 | |
with: | |
server_address: smtp.gmail.com # Replace with your SMTP server address | |
server_port: 587 # Typically 587 for TLS | |
username: ${{ secrets.SMTP_USERNAME }} # Stored in GitHub Secrets | |
password: ${{ secrets.SMTP_PASSWORD }} # Stored in GitHub Secrets | |
subject: "Test Status - ${{ github.workflow }}" | |
body: "The test run for the project has completed with status: ${{ job.status }}" | |
to: "sl-qa@shikshalokam.org" # Replace with recipient's email address | |
from: "automation@shikshalokam.org" # Replace with sender's email address | |
secure: true |