<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Updated GitHub Actions workflows to use `actions/checkout@v4` for improved performance and reliability. - Removed `fetch-depth` parameter to simplify checkout steps across various workflows. - Standardized quote usage for consistency in workflow files. - **Documentation** - Adjusted formatting and descriptions in workflow files for better clarity and readability. - **Refactor** - Aligned multiple workflow files to follow a consistent structure and naming convention. <!-- end of auto-generated comment: release notes by coderabbit.ai --> fetch-depth 0 causes the Github workflow to checkout the entire Git history. This is not required. We only need to check out the head of the commit. By default, actions/checkout has fetch-depth=1, hence removing it from the workflow completely for simplicity.
37 lines
1007 B
YAML
37 lines
1007 B
YAML
# This workflow is responsible for running Spotless check on server code base
|
|
name: Server Spotless Check
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
pr:
|
|
description: "This is the PR number in case the workflow is being called in a pull request"
|
|
required: false
|
|
type: number
|
|
|
|
# Change the working directory for all the jobs in this workflow
|
|
defaults:
|
|
run:
|
|
working-directory: app/server
|
|
|
|
jobs:
|
|
spotless-check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
# Check out merge commit with the base branch in case this workflow is invoked via pull request
|
|
- name: Checkout the merged commit from PR and base branch
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: refs/pull/${{ inputs.pr }}/merge
|
|
|
|
# Setup Java
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
distribution: "temurin"
|
|
java-version: "17"
|
|
|
|
# Run maven step for spotless check
|
|
- name: Run spotless check
|
|
run: mvn spotless:check
|