Workspace aware sharing records #15890
Workflow file for this run
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: Code Hygiene | |
| on: [push, pull_request] | |
| jobs: | |
| linelint: | |
| runs-on: ubuntu-latest | |
| name: Check if all files end in newline | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 | |
| - name: Linelint | |
| uses: fernandrone/linelint@7907a5dca0c28ea7dd05c6d8d8cacded713aca11 # 0.0.6 | |
| spotless: | |
| runs-on: ubuntu-latest | |
| name: Spotless scan | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 | |
| - uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0 | |
| with: | |
| distribution: temurin # Temurin is a distribution of adoptium | |
| java-version: 21 | |
| - uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 | |
| with: | |
| cache-disabled: true | |
| - run: ./gradlew spotlessCheck | |
| checkstyle: | |
| runs-on: ubuntu-latest | |
| name: Checkstyle scan | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 | |
| - uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0 | |
| with: | |
| distribution: temurin # Temurin is a distribution of adoptium | |
| java-version: 21 | |
| - uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 | |
| with: | |
| cache-disabled: true | |
| - run: ./gradlew checkstyleMain checkstyleTest checkstyleIntegrationTest | |
| spotbugs: | |
| runs-on: ubuntu-latest | |
| name: Spotbugs scan | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 | |
| - uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0 | |
| with: | |
| distribution: temurin # Temurin is a distribution of adoptium | |
| java-version: 21 | |
| - uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 | |
| with: | |
| cache-disabled: true | |
| - run: ./gradlew spotbugsMain | |
| check-permissions-order: | |
| runs-on: ubuntu-latest | |
| name: Check permissions orders | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 | |
| - run: npm install yaml | |
| - name: Check permissions order | |
| run: | | |
| exclude_pattern="(^|/)roles_invalidxcontent.yml($|/) | |
| (^|/)invalid_config/config.yml($|/)" | |
| # Set pattern to exclude certain files | |
| set -e | |
| exit_code=0 | |
| for file in $(find . -name '*.yml' | grep -Ev "$exclude_pattern"); do | |
| if ! node check-permissions-order.js "$file" --slient; then | |
| exit_code=1 | |
| echo "Error: $file requires changes. Run the following command to fix:" | |
| echo "node check-permissions-order.js $file --fix" | |
| fi | |
| done | |
| exit $exit_code |