bitwarden-android/.github/workflows/run-check.yml

69 lines
2.2 KiB
YAML
Raw Normal View History

---
name: Run Check
on:
pull_request:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JAVA_VERSION: 17
RUBY_VERSION: 3.2.2
jobs:
test:
name: Test
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
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
2024-02-05 21:28:09 +03:00
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@699bb18358f12c5b78b37bb0111d3a0e2276e0e2 # v2.1.1
2024-02-05 21:28:09 +03:00
- name: Cache Gradle Files
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
2024-02-05 21:28:09 +03:00
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-v2-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-v2-
- name: Configure Ruby
uses: ruby/setup-ruby@d4526a55538b775af234ba4af27118ed6f8f6677 # v1.172.0
with:
bundler-cache: true
ruby-version: ${{ env.RUBY_VERSION }}
- name: Configure JDK
uses: actions/setup-java@9704b39bf258b59bc04b50fa2dd55e9ed76b47a8 # v4.1.0
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 \
-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