Skip to content

New message style

New message style #124

Workflow file for this run

name: pr_build
on:
pull_request:
branches: [ main ]
jobs:
formatCode:
runs-on: ubuntu-latest
if: ${{ !contains(github.actor, 'github-actions[bot]') }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.ACTION_TOKEN }}
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Set Git Username
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Format code
run: |
sbt scalafmtAll
- name: Check for changes
run: |
if git diff-index --quiet HEAD; then
echo "IS_CHANGED=false" >> $GITHUB_ENV
else
echo "IS_CHANGED=true" >> $GITHUB_ENV
fi
- name: Push code if format is needed
if: ${{ env.IS_CHANGED == 'true' }}
run: |
git add --all
git commit -m ":recycle: format code"
git push origin ${{ github.head_ref }}
build:
needs: formatCode
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Clean and Compile
run: sbt clean compile
test:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Test
run: sbt test