From 6f0b8ac6891582f79822592ddc349a699e0105df Mon Sep 17 00:00:00 2001 From: androidacy-user Date: Mon, 1 May 2023 14:13:03 -0400 Subject: [PATCH] Fix actions builds Signed-off-by: androidacy-user --- .github/workflows/build-debug.yml | 1 + .github/workflows/codeql.yml | 76 +++++++++++++++++++------------ settings.gradle.kts | 2 + 3 files changed, 50 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index 8583dd6..cfdfb3b 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -44,6 +44,7 @@ jobs: caches notifications jdks + ${{ github.workspace }}/.gradle/configuration-cache - name: Change wrapper permissions run: chmod +x ./gradlew diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 6bb9e2d..1aed7d3 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -14,8 +14,7 @@ name: "CodeQL" on: push: branches: [ "master" ] - pull_request: - # The branches below must be a subset of the branches above + pull_request: # The branches below must be a subset of the branches above branches: [ "master" ] schedule: - cron: '24 17 * * 0' @@ -39,38 +38,57 @@ jobs: # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. - # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality - # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 + - name: Set up Java 19 + uses: actions/setup-java@v3 + with: + java-version: 19 + distribution: 'temurin' - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + - name: Setup Android SDK + uses: android-actions/setup-android@v2 - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-includes: | + caches + notifications + jdks + ${{ github.workspace }}/.gradle/configuration-cache - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh + - name: Change wrapper permissions + run: chmod +x ./gradlew - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: "/language:${{matrix.language}}" + - name: Build apk debug + run: ./gradlew app:assembleDefaultDebug + + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" diff --git a/settings.gradle.kts b/settings.gradle.kts index 86fffb7..c326976 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -23,6 +23,8 @@ dependencyResolutionManagement { } } +enableFeaturePreview("STABLE_CONFIGURATION_CACHE") + // val isCiServer = System.getenv().containsKey("CI") // Cache build artifacts, so expensive operations do not need to be re-computed buildCache {