From 8b9f02a21ce4e615c035b23913cbf1fdfcb26bff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 11:05:30 -0500 Subject: [PATCH] chore(deps): bump the github-action-dependencies group with 1 update (#263) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Levi Bostian --- .github/actions/setup-android/action.yml | 20 ++++++++++++++++++++ .github/workflows/binary-validator.yml | 9 ++------- .github/workflows/build-sample-apps.yml | 16 +--------------- .github/workflows/deploy-sdk.yml | 6 +----- .github/workflows/lint.yml | 14 ++------------ .github/workflows/manual-deployment.yml | 6 +----- .github/workflows/snapshot-release.yml | 6 +----- .github/workflows/test.yml | 18 ++---------------- 8 files changed, 30 insertions(+), 65 deletions(-) create mode 100644 .github/actions/setup-android/action.yml diff --git a/.github/actions/setup-android/action.yml b/.github/actions/setup-android/action.yml new file mode 100644 index 000000000..673cfd803 --- /dev/null +++ b/.github/actions/setup-android/action.yml @@ -0,0 +1,20 @@ +name: Setup Android +description: Setup CI with Android development tools to compile and test Android source code. + +runs: + using: "composite" + steps: + - name: Install Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + + - name: Install Android SDK + uses: android-actions/setup-android@v3 + + - name: Verify gradle scripts are valid gradle scripts + uses: gradle/wrapper-validation-action@v1 + + - name: Setup Gradle and cache dependencies between builds + uses: gradle/gradle-build-action@v2 \ No newline at end of file diff --git a/.github/workflows/binary-validator.yml b/.github/workflows/binary-validator.yml index bbbe2ecd6..35d2cfd42 100644 --- a/.github/workflows/binary-validator.yml +++ b/.github/workflows/binary-validator.yml @@ -8,11 +8,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up JDK - uses: actions/setup-java@v3 - with: - distribution: 'adopt' - java-version: '11' + - uses: ./.github/actions/setup-android - name: API check - run: ./gradlew apiCheck - + run: ./gradlew apiCheck \ No newline at end of file diff --git a/.github/workflows/build-sample-apps.yml b/.github/workflows/build-sample-apps.yml index 6cd8b7d42..e2748bf2a 100644 --- a/.github/workflows/build-sample-apps.yml +++ b/.github/workflows/build-sample-apps.yml @@ -69,20 +69,12 @@ jobs: name: Building app...${{ matrix.sample-app }} steps: - uses: actions/checkout@v4 - - - name: Set up JDK - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '11' + - uses: ./.github/actions/setup-android # CLI to replace strings in files. The CLI recommends using `cargo install` which is slow. This Action is fast because it downloads pre-built binaries. # If using sd on macos, "brew install" works great. for Linux, this is the recommended way. - name: Install sd CLI to use later in the workflow uses: kenji-miyake/setup-sd@v1 - - - name: Setup Android SDK - uses: android-actions/setup-android@v2 - name: Install tools from Gemfile (ruby language) used for building our apps with uses: ruby/setup-ruby@v1 @@ -95,12 +87,6 @@ jobs: touch "samples/local.properties" echo "siteId=${{ secrets[matrix.cio-siteid-secret-key] }}" >> "samples/local.properties" echo "apiKey=${{ secrets[matrix.cio-apikey-secret-key] }}" >> "samples/local.properties" - - - name: Verify gradle scripts are not modified - uses: gradle/wrapper-validation-action@v1 - - - name: Setup Gradle and cache dependencies between builds - uses: gradle/gradle-build-action@v2 - name: Dump GitHub Action metadata because Fastlane uses it. Viewing it here helps debug JSON parsing code in Firebase. run: cat $GITHUB_EVENT_PATH diff --git a/.github/workflows/deploy-sdk.yml b/.github/workflows/deploy-sdk.yml index 47d55aeff..7410d8353 100644 --- a/.github/workflows/deploy-sdk.yml +++ b/.github/workflows/deploy-sdk.yml @@ -129,11 +129,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up JDK - uses: actions/setup-java@v3 - with: - distribution: adopt - java-version: 11 + - uses: ./.github/actions/setup-android - name: Push to Sonatype servers run: MODULE_VERSION=${{ needs.deploy-git-tag.outputs.new_release_version }} ./scripts/deploy-code.sh env: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a657789e5..ab998eb7d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,13 +11,7 @@ jobs: name: Android Lint (${{ matrix.module }}) steps: - uses: actions/checkout@v4 - - name: Set up JDK - uses: actions/setup-java@v3 - with: - distribution: 'adopt' - java-version: '11' # Robolectric requires v9, but we choose LTS: https://adoptopenjdk.net/ - - name: Setup Android SDK - uses: android-actions/setup-android@v2 + - uses: ./.github/actions/setup-android - name: Run lint (${{ matrix.module }}) run: ./gradlew :${{ matrix.module }}:lintDebug @@ -34,11 +28,7 @@ jobs: name: Kotlin Lint steps: - uses: actions/checkout@v4 - - name: Set up JDK - uses: actions/setup-java@v3 - with: - distribution: 'adopt' - java-version: '11' # Robolectric requires v9, but we choose LTS: https://adoptopenjdk.net/ + - uses: ./.github/actions/setup-android - name: Install and run ktlint run: make lint-install && make lint-no-format diff --git a/.github/workflows/manual-deployment.yml b/.github/workflows/manual-deployment.yml index 71f591b33..0472f4dd0 100644 --- a/.github/workflows/manual-deployment.yml +++ b/.github/workflows/manual-deployment.yml @@ -23,11 +23,7 @@ jobs: echo "TAG=$TAG" >> $GITHUB_ENV echo '::endgroup::' - - name: Set up JDK - uses: actions/setup-java@v3 - with: - distribution: adopt - java-version: 11 + - uses: ./.github/actions/setup-android - name: Push to Sonatype servers run: MODULE_VERSION=${{ env.TAG }} ./scripts/deploy-code.sh diff --git a/.github/workflows/snapshot-release.yml b/.github/workflows/snapshot-release.yml index 7aeac28b5..dd8bfc905 100644 --- a/.github/workflows/snapshot-release.yml +++ b/.github/workflows/snapshot-release.yml @@ -12,11 +12,7 @@ jobs: steps: - name: Check out code uses: actions/checkout@v4 - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - distribution: adopt - java-version: 11 + - uses: ./.github/actions/setup-android # Using branch name for name of snapshot. Makes it easy to remember and can easily trigger new builds of Remote Habits. - name: Set snapshot version diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e67264b9e..53281d665 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,13 +11,7 @@ jobs: name: Unit tests (${{ matrix.module }}) steps: - uses: actions/checkout@v4 - - name: Set up JDK - uses: actions/setup-java@v3 - with: - distribution: 'adopt' - java-version: '11' # Robolectric requires v9, but we choose LTS: https://adoptopenjdk.net/ - - name: Setup Android SDK - uses: android-actions/setup-android@v2 + - uses: ./.github/actions/setup-android - name: Run unit tests (${{ matrix.module }}) run: ./gradlew :${{ matrix.module }}:runJacocoTestReport - name: Upload code coverage report @@ -44,15 +38,7 @@ jobs: sample: [kotlin_compose, java_layout] steps: - uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'adopt' - java-version: '17' - - name: Setup Android SDK - uses: android-actions/setup-android@v2 - - name: Gradle cache - uses: gradle/gradle-build-action@v2 + - uses: ./.github/actions/setup-android - name: Start emulator uses: reactivecircus/android-emulator-runner@v2 with: