Skip to content

Update quality assurance workflow to improve code formatting*** #54

Update quality assurance workflow to improve code formatting***

Update quality assurance workflow to improve code formatting*** #54

name: Quality Assurance
on: [workflow_call, push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "temurin"
- name: Setup Gradle
uses: ./.github/actions/setup-gradle
- name: Tests
run: gradle test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ktlint
uses: ./.github/actions/setup-ktlint
- run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
git diff --name-only --relative --color never ${{ github.event.before }} ${{ github.event.after }} -- '*.kt' '*.kts'
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
ktlint --relative $(gh pr diff --name-only --color never ${{ github.event.number }} | grep -E "\.kts?$" | xargs printf -- '%s\n' | tr '\n' ' ')
fi
env:
GITHUB_TOKEN: ${{ github.token }}