bitwarden-android/.github/workflows/run-check.yml
2024-06-20 17:08:07 +01:00

67 lines
2.2 KiB
YAML

---
name: Run Check
on:
pull_request:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JAVA_VERSION: 17
jobs:
test:
name: Test
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
fetch-depth: 0
# Allow subsequent steps to trigger GitHub Actions via git push
# https://github.community/t/push-from-action-even-with-pat-does-not-trigger-action/17622
persist-credentials: false
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@b5418f5a58f5fd2eb486dd7efb368fe7be7eae45 # v2.1.3
- name: Cache Gradle Files
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
${{ github.workspace }}/build-cache
key: ${{ runner.os }}-gradle-v2-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/libs.versions.toml') }}
restore-keys: |
${{ runner.os }}-gradle-v2-
- name: Configure Ruby
uses: ruby/setup-ruby@1198b074305f9356bd56dd4b311757cc0dab2f1c # v1.175.1
with:
bundler-cache: true
- name: Configure JDK
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: 'temurin'
java-version: ${{ env.JAVA_VERSION }}
- name: Build and Run Check
# Run checks while excluding release-build tests, which are not configured to work properly
# with the Compose testing library. Also exclude most FDroid-related tasks, as there is no
# significant code difference between builds.
run: |
./gradlew check --no-daemon \
-x testStandardRelease \
-x testFdroidDebug \
-x testFdroidRelease \
-x lintFdroidDebug \
-x lintFdroidRelease \
-x detektFdroidDebug \
-x detektFdroidRelease \
koverXmlReportStandardDebug
- name: Danger
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bundle exec danger