autonomouslogic/dynamo-mapper

View on GitHub
.github/workflows/codegen.yml

Summary

Maintainability
Test Coverage
name: Codegen check
on: [ push ]
jobs:
  Codegen:
    timeout-minutes: 30
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Java
        uses: actions/setup-java@v4
        with:
          distribution: adopt
          java-version: 11

      - name: Caches
        uses: actions/cache@v4
        with:
          path: |
            ~/.gradle/caches
            ~/.gradle/wrapper
          key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
          restore-keys: |
            ${{ runner.os }}-gradle-

      - name: Generate
        run: |
          ./gradlew codegen
          ./gradlew spotlessApply

      - name: Code change check
        run: |
          if [[ `git status --porcelain` ]]; then echo "Changed code detected, run codegen before comitting"; git diff; exit 1; fi