Skip to content

Commit

Permalink
Update android-test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
udenr authored Feb 13, 2024
1 parent 801155f commit 8dd3144
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/android-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ jobs:
runs-on: ubuntu-latest
outputs:
status: ${{ steps.check-androidTest.outputs.NOT_EMPTY }}
min-sdk-version: ${{ steps.get-sdk-version.outputs.MIN_SDK_VERSION }}
target-sdk-version: ${{ steps.get-sdk-version.outputs.TARGET_SDK_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -16,13 +18,20 @@ jobs:
echo "NOT_EMPTY=$([ "$(ls -A app/src/androidTest)" ] && echo 'true' || echo 'false')"
echo "NOT_EMPTY=$([ "$(ls -A app/src/androidTest)" ] && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
id: check-androidTest
- name: Get min and target sdk
if: steps.check-androidTest.outputs.NOT_EMPTY == 'true'
id: get-sdk-version
run: |
echo "MIN_SDK_VERSION=$(cat app/build.gradle | grep minSdkVersion | rev | cut -d' ' -f 1 | rev)" >> $GITHUB_OUTPUT
echo "TARGET_SDK_VERSION=$(cat app/build.gradle | grep targetSdkVersion | rev | cut -d' ' -f 1 | rev)" >> $GITHUB_OUTPUT
test:
needs: check-if-tests-exist
if: needs.check-if-tests-exist.outputs.status == 'true'
runs-on: ubuntu-latest
strategy:
matrix:
api-level: [21, 29, 34]
api-level: [21, 29, 34, "${{ needs.check-if-tests-exist.outputs.min-sdk-version }}", "${{ needs.check-if-tests-exist.outputs.target-sdk-version }}"]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down

0 comments on commit 8dd3144

Please sign in to comment.