Skip to content

Create maven.yml

Create maven.yml #8

Workflow file for this run

name: CC-Visualizer
on:
push:
branches: [ main ]
schedule:
- cron: "0 4 * * *"
workflow_dispatch:
permissions:
contents: write
jobs:
stats-generation:
runs-on: ubuntu-latest
steps:
# Check out repository under $GITHUB_WORKSPACE, so the job can access it
- uses: actions/checkout@v2
# Set up JDK 17
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '17'
# Cache dependencies
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Build the Java project with Maven
- name: Build with Maven
run: mvn -B clean install --file ./pom.xml
# Generate all statistics images
- name: Generate images
run: |
javac src/main/java/com/ccvisualizer/ccvisualizer/CcVisualizerApplication.java
java -cp src/main/java com.ccvisualizer.ccvisualizer.CcVisualizerApplication
# Commit all changed files to the repository
- name: Commit to the repo
run: |
git config --global user.name gaurishiiitnr
git config --global user.email [email protected]
git add .
# Force the build to succeed, even if no files were changed
git commit -m 'Update generated files' || true
git push