Tidy FileUtils.java #2107
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
pull_request: | |
branches: | |
- '**' | |
types: | |
- opened | |
- synchronize | |
push: | |
branches: | |
- main | |
workflow_call: {} | |
workflow_dispatch: {} | |
jobs: | |
linting: | |
name: Linting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Initialize Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 22 | |
- name: Run Maven checks | |
shell: bash | |
run: >- | |
./mvnw -B -U | |
-DskipTests=true | |
-Dmaven.main.skip | |
-Dmaven.jar.skip | |
-Dmaven.resources.skip | |
-Dmaven.test.skip | |
-Dinvoker.skip | |
verify | |
- name: Run ShellCheck | |
uses: ludeeus/action-shellcheck@master | |
with: | |
check_together: 'yes' | |
scandir: './scripts' | |
- name: Validate codecov.yml | |
continue-on-error: false | |
if: always() | |
shell: bash | |
run: curl --fail -vv --data-binary @codecov.yml https://codecov.io/validate | |
build: | |
name: Build on JDK ${{ matrix.java-version }} (${{ matrix.os-name }}) | |
runs-on: ${{ matrix.os-name }} | |
needs: | |
- linting | |
strategy: | |
fail-fast: false | |
matrix: | |
os-name: [ubuntu-latest] | |
java-version: | |
- 11 | |
- 12 | |
- 13 | |
- 14 | |
- 15 | |
- 16 | |
- 17 | |
- 18 | |
- 19 | |
- 20 | |
- 21 | |
- 22 | |
- 23-ea | |
include: | |
- os-name: macos-latest | |
java-version: 22 | |
- os-name: windows-latest | |
java-version: 22 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Initialize JDK | |
uses: actions/setup-java@v4 | |
with: | |
check-latest: true | |
distribution: zulu | |
java-version: ${{ matrix.java-version }} | |
- name: Compile and run tests | |
shell: bash | |
run: ./mvnw -B -U -Dcheckstyle.skip=true -Dlicense.skip=true clean verify | |
# TODO: work out why the v4 plugin does not work. | |
- name: Upload to codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
name: tests-java-${{ matrix.java-version }}-os-${{ matrix.os-name }} | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Stash reports | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: reports-${{ matrix.java-version }}-${{ matrix.os-name }} | |
if-no-files-found: error | |
path: | | |
**/surefire-reports/** | |
**/failsafe-reports/** | |
**/build*.log | |
retention-days: 30 | |
generate-snapshot-documentation: | |
name: Generate snapshot documentation | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write | |
id-token: write | |
needs: | |
- linting | |
concurrency: | |
cancel-in-progress: false | |
group: snapshot-javadocs | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Initialize Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
# Must use >= JDK 17 for JavaDocs to generate correctly. | |
java-version: 22 | |
- name: Generate JavaDocs | |
shell: bash | |
run: >- | |
./mvnw -B -U -am -pl java-compiler-testing | |
-Dmaven.test.skip=true | |
-Dcheckstyle.skip=true | |
-Dlicense.skip=true | |
clean compile javadoc:jar | |
- name: Upload JavaDocs as a build artifact | |
uses: actions/upload-pages-artifact@v3 | |
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' | |
with: | |
path: java-compiler-testing/target/apidocs | |
- name: Deploy JavaDocs build artifact to GitHub Pages | |
id: snapshot-javadocs | |
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' | |
uses: actions/deploy-pages@v4 |