diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be175c0436..8832499c43 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,14 +25,10 @@ jobs: cancel-in-progress: true steps: - uses: actions/checkout@v3 - - uses: actions/cache@v3 + - name: Configure gradle + uses: gradle/gradle-build-action@v2 with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-gradle- + cache-read-only: ${{ github.ref != 'refs/heads/develop' }} - name: Assemble ${{ matrix.target }} debug apk run: ./gradlew assemble${{ matrix.target }}Debug $CI_GRADLE_ARG_PROPERTIES - name: Upload ${{ matrix.target }} debug APKs @@ -50,14 +46,10 @@ jobs: cancel-in-progress: ${{ github.ref != 'refs/head/main' }} steps: - uses: actions/checkout@v3 - - uses: actions/cache@v3 + - name: Configure gradle + uses: gradle/gradle-build-action@v2 with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-gradle- + cache-read-only: ${{ github.ref != 'refs/heads/develop' }} - name: Assemble GPlay unsigned apk run: ./gradlew clean assembleGplayRelease $CI_GRADLE_ARG_PROPERTIES - name: Upload Gplay unsigned APKs diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 51c1b32e82..2f53964ebb 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -19,14 +19,10 @@ jobs: uses: actions/setup-python@v4 with: python-version: 3.8 - - uses: actions/cache@v3 + - name: Configure gradle + uses: gradle/gradle-build-action@v2 with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-gradle- + cache-read-only: ${{ github.ref != 'refs/heads/develop' }} - name: Install towncrier run: | python3 -m pip install towncrier diff --git a/.github/workflows/post-pr.yml b/.github/workflows/post-pr.yml index af854bf371..0245fcdd34 100644 --- a/.github/workflows/post-pr.yml +++ b/.github/workflows/post-pr.yml @@ -44,14 +44,14 @@ jobs: uses: actions/setup-python@v4 with: python-version: 3.8 - - uses: actions/cache@v3 + - uses: actions/setup-java@v3 with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-gradle- + distribution: 'adopt' + java-version: '11' + - name: Configure gradle + uses: gradle/gradle-build-action@v2 + with: + cache-read-only: ${{ github.ref != 'refs/heads/develop' }} - name: Start synapse server uses: michaelkaye/setup-matrix-synapse@v1.0.4 with: @@ -59,10 +59,6 @@ jobs: httpPort: 8080 disableRateLimiting: true public_baseurl: "http://10.0.2.2:8080/" - - uses: actions/setup-java@v3 - with: - distribution: 'adopt' - java-version: '11' - name: Run sanity tests on API ${{ matrix.api-level }} uses: reactivecircus/android-emulator-runner@v2 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 931ec2da45..d9ae49a5f0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -139,14 +139,10 @@ jobs: # with: # distribution: 'adopt' # java-version: 11 -# - uses: actions/cache@v3 +# - name: Configure gradle +# uses: gradle/gradle-build-action@v2 # with: -# path: | -# ~/.gradle/caches -# ~/.gradle/wrapper -# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} -# restore-keys: | -# ${{ runner.os }}-gradle- +# cache-read-only: ${{ github.ref != 'refs/heads/develop' }} # - name: Build Android Tests # run: ./gradlew clean assembleAndroidTest $CI_GRADLE_ARG_PROPERTIES