Add a basic test for native Surface #739
Workflow file for this run
This file contains 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: Check Code Style | |
on: | |
push: | |
branches: [ master, 'robolectric-*.x' ] | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
branches: [ master, google ] | |
paths-ignore: | |
- '**.md' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
jobs: | |
check_code_style: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: 17 | |
- name: Download google-java-format 1.9 | |
run: | | |
curl -L -o $HOME/google-java-format.jar https://github.com/google/google-java-format/releases/download/v1.15.0/google-java-format-1.15.0-all-deps.jar | |
curl -L -o $HOME/google-java-format-diff.py https://raw.githubusercontent.com/google/google-java-format/v1.15.0/scripts/google-java-format-diff.py | |
chmod +x $HOME/google-java-format-diff.py | |
- name: Check Java formatting | |
run: | | |
base_branch="${{ github.event.pull_request.base.ref }}" | |
echo "Running google-java-format-diff against 'origin/$base_branch'" | |
git fetch origin "$base_branch" --depth 1 | |
diff=$(git diff -U0 $(git merge-base HEAD origin/$base_branch) | $HOME/google-java-format-diff.py --google-java-format-jar=$HOME/google-java-format.jar -p1) | |
if [[ $diff ]]; then | |
echo "Please run google-java-format on the changes in this pull request" | |
git diff -U0 $(git merge-base HEAD origin/$base_branch) | $HOME/google-java-format-diff.py --google-java-format-jar=$HOME/google-java-format.jar -p1 | |
exit 1 | |
fi | |
- name: Check Kotlin formatting | |
run: | | |
./gradlew spotlessCheck | |
- name: Check Kotlin Code Style | |
run: | | |
./gradlew detekt |