Update codeql.yml #37
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: Checker | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Check TWA | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup JDK | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
java-package: 'jdk' | |
architecture: 'x64' | |
check-latest: false | |
server-id: 'github' | |
server-username: ${{ github.actor }} | |
server-password: ${{ secrets.GITHUB_TOKEN }} | |
overwrite-settings: true | |
job-status: 'success' | |
distribution: 'adopt' | |
- name: Install Gradle | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gradle | |
working-directory: android | |
- name: Check if build directory exists | |
id: check_build_dir | |
run: test -d android/build && echo "Build directory found" || echo "Build directory not found" | |
- name: Adjust gradlew permissions | |
run: | | |
ls -l android/gradlew | |
chmod +x android/gradlew | |
ls -l android/gradlew | |
if: steps.check_build_dir.outputs.status != 'Build directory found' | |
- name: Verify gradlew permissions | |
run: | | |
ls -l android/gradlew | |
if: steps.check_build_dir.outputs.status != 'Build directory found' | |
- name: Run lint | |
run: | | |
cd android | |
./gradlew lint | |
if: steps.check_build_dir.outputs.status == 'Build directory found' | |
- name: Run tests | |
run: | | |
cd android | |
./gradlew test | |
if: steps.check_build_dir.outputs.status == 'Build directory found' | |
- name: Run TWA validation script | |
run: | | |
cd android | |
./gradlew connectedAndroidTest | |
if: steps.check_build_dir.outputs.status == 'Build directory found' | |
- name: Cleanup | |
run: | | |
rm -rf android/.gradle | |
working-directory: android |