mirror of
https://github.com/Wurst-Imperium/Wurst7.git
synced 2024-09-20 01:12:13 +02:00
68 lines
1.6 KiB
YAML
68 lines
1.6 KiB
YAML
name: Java CI with Gradle
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- '**.java'
|
|
- '**.json'
|
|
- 'gradle**'
|
|
- 'build.gradle'
|
|
pull_request:
|
|
paths:
|
|
- '**.java'
|
|
- '**.json'
|
|
- 'gradle**'
|
|
- 'build.gradle'
|
|
# Makes it possible to run this workflow manually from the Actions tab
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Validate Gradle wrapper
|
|
uses: gradle/actions/wrapper-validation@v3
|
|
|
|
- name: Set up Java 21
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: '21'
|
|
distribution: 'microsoft'
|
|
|
|
- name: Grant execute permission for gradlew
|
|
run: chmod +x gradlew
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v3
|
|
|
|
- name: Generate and submit dependency graph
|
|
if: ${{ github.event_name == 'push' }}
|
|
uses: gradle/actions/dependency-submission@v3
|
|
with:
|
|
build-scan-publish: true
|
|
build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use"
|
|
build-scan-terms-of-use-agree: "yes"
|
|
|
|
- name: Check code style with Spotless
|
|
id: spotless_check
|
|
run: ./gradlew spotlessCheck
|
|
|
|
- name: Execute Gradle build
|
|
run: ./gradlew build --stacktrace --warning-mode=fail
|
|
|
|
- name: VirusTotal scan
|
|
if: ${{ github.event_name == 'push' }}
|
|
uses: crazy-max/ghaction-virustotal@v4
|
|
with:
|
|
vt_api_key: ${{ secrets.VIRUSTOTAL_API_KEY }}
|
|
files: |
|
|
./build/libs/*.jar
|
|
continue-on-error: true
|