mirror of
https://github.com/bitwarden/android.git
synced 2026-10-22 02:53:19 -05:00
85 lines
2.3 KiB
YAML
85 lines
2.3 KiB
YAML
name: Test
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "main"
|
|
- "rc"
|
|
- "hotfix-rc"
|
|
pull_request_target:
|
|
types: [opened, synchronize]
|
|
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
JAVA_VERSION: 17
|
|
|
|
jobs:
|
|
check-run:
|
|
name: Check PR run
|
|
uses: bitwarden/gh-actions/.github/workflows/check-run.yml@main
|
|
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-22.04
|
|
needs: check-run
|
|
permissions:
|
|
contents: read
|
|
packages: read
|
|
pull-requests: write
|
|
|
|
steps:
|
|
- name: Check out repo
|
|
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
- name: Validate Gradle wrapper
|
|
uses: gradle/actions/wrapper-validation@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
|
|
|
|
- name: Cache Gradle files
|
|
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-v2-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/libs.versions.toml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gradle-v2-
|
|
|
|
- name: Cache build output
|
|
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
|
with:
|
|
path: |
|
|
${{ github.workspace }}/build-cache
|
|
key: ${{ runner.os }}-build-cache-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-build-
|
|
|
|
- name: Configure Ruby
|
|
uses: ruby/setup-ruby@0cde4689ba33c09f1b890c1725572ad96751a3fc # v1.178.0
|
|
with:
|
|
bundler-cache: true
|
|
|
|
- name: Configure JDK
|
|
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
|
|
with:
|
|
distribution: "temurin"
|
|
java-version: ${{ env.JAVA_VERSION }}
|
|
|
|
- name: Install Fastlane
|
|
run: |
|
|
gem install bundler:2.2.27
|
|
bundle config path vendor/bundle
|
|
bundle install --jobs 4 --retry 3
|
|
|
|
- name: Build and test
|
|
run: |
|
|
bundle exec fastlane check
|
|
|
|
- name: Upload to codecov.io
|
|
uses: codecov/codecov-action@125fc84a9a348dbcf27191600683ec096ec9021c # v4.4.1
|
|
with:
|
|
file: app/build/reports/kover/reportDebug.xml
|
|
env:
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|