diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca866401d..bbc9c8ccf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,12 +2,62 @@ name: CI on: workflow_dispatch: + pull_request: + branches: + - dev + - master + paths-ignore: + - 'README.md' + - 'doc/**' + - 'fastlane/**' + - 'assets/**' + - '.github/**/*.md' + - '.github/FUNDING.yml' + - '.github/ISSUE_TEMPLATE/**' + push: + branches: + - dev + - master + paths-ignore: + - 'README.md' + - 'doc/**' + - 'fastlane/**' + - 'assets/**' + - '.github/**/*.md' + - '.github/FUNDING.yml' + - '.github/ISSUE_TEMPLATE/**' jobs: - build-and-release: - + build: runs-on: ubuntu-latest + permissions: write-all + steps: - - name: Print environment - run: env | grep ^GITHUB + - name: Checkout branch "${{ github.ref_name }}" + run: | + git clone --no-checkout https://github.com/polymorphicshade/Tubular.git . + git config core.symlinks false + git checkout --progress --force ${{ github.ref_name }} + + - name: Validate Gradle files + uses: gradle/wrapper-validation-action@v2 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: "temurin" + cache: 'gradle' + + - name: Clean APKs + run: rm -rf app/build/outputs/apk/ + + - name: Build debug APK and run jvm tests + run: ./gradlew assembleDebug lintDebug testDebugUnitTest --stacktrace -DskipFormatKtlint + + - name: Upload APK + uses: actions/upload-artifact@v4 + with: + name: app + path: app/build/outputs/apk/debug/*.apk