Skip to content

ci: Add "needs: formatting" to the build workflow #5

ci: Add "needs: formatting" to the build workflow

ci: Add "needs: formatting" to the build workflow #5

Workflow file for this run

name: Build
on:
workflow_dispatch:
push:
branches: [ master, main ]
pull_request:
jobs:
formatting:
name: Format code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- run: chmod +x gradlew
- name: Build project
run: ./gradlew spotlessApply
- name: Commit changes
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "style: format code with spotless"
git push
build:
name: Build
runs-on: ubuntu-latest
needs: formatting
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- run: chmod +x gradlew
- name: Build project
run: ./gradlew build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: plugin-files
path: build/libs/*.jar