Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,27 @@ jobs:
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v7
with:
# ratchetFrom needs history reachable to the base/before commit
fetch-depth: 0
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v5
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: maven
- name: Determine Spotless ratchet ref
shell: bash
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
ref="${{ github.event.pull_request.base.sha }}"
else
ref="${{ github.event.before }}"
[ "$ref" = "0000000000000000000000000000000000000000" ] && ref=""
fi
[ -n "$ref" ] && echo "RATCHET=-DratchetFrom=$ref" >> "$GITHUB_ENV"
Comment on lines +41 to +50

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to make generic in case of multiple branches

- name: Build with Maven
run: ./mvnw $mvn_options install -PnoGpg --file pom.xml
run: ./mvnw $mvn_options install $RATCHET -PnoGpg --file pom.xml
- name: Run ProvidersDocsGenerator
if: ${{ matrix.java-version == env.jdk_for_downstream && matrix.runs-on == env.os_for_downstream }}
run: ./mvnw $mvn_options exec:java -Dexec.mainClass="net.datafaker.script.ProvidersDocsGenerator" -Dexec.classpathScope=test -PnoGpg --file pom.xml
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ bin/
site
.mvn/wrapper/maven-wrapper.jar
/.claude/settings.local.json
.spotless-index-file
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
<javaparser.version>3.28.2</javaparser.version>
<snakeyaml.version>2.6</snakeyaml.version>
<spotless-maven-plugin.version>3.7.0</spotless-maven-plugin.version>
<!-- Empty means scan all, non empty value will be passed from CI -->
<spotless.ratchetFrom></spotless.ratchetFrom>
<!-- Run tests in Turkish to make sure that they don't depend on
locale. Turkish is a notoriously tricky locale. -->
<surefire.argline>@{argLine} -Duser.language=TR -Duser.country=tr</surefire.argline>
Expand Down Expand Up @@ -269,6 +271,11 @@
</yamlFeatures>
</jackson>
</yaml>
<upToDateChecking>
<enabled>true</enabled>
<indexFile>${project.basedir}/.spotless-index-file</indexFile>
</upToDateChecking>
<ratchetFrom>${spotless.ratchetFrom}</ratchetFrom>
</configuration>
<executions>
<execution>
Expand Down
Loading