bitwarden-android/.github/workflows/test.yml

87 lines
2.4 KiB
YAML
Raw Normal View History

2024-05-30 18:01:05 +03:00
name: Test
on:
2024-05-30 18:01:05 +03:00
push:
branches:
- "main"
- "rc"
- "hotfix-rc"
pull_request_target:
types: [opened, synchronize]
workflow_dispatch:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JAVA_VERSION: 17
jobs:
2024-05-30 18:01:05 +03:00
check-run:
name: Check PR run
uses: bitwarden/gh-actions/.github/workflows/check-run.yml@main
test:
name: Test
runs-on: ubuntu-22.04
2024-05-30 18:01:05 +03:00
needs: check-run
permissions:
contents: read
issues: write
2024-05-30 18:20:07 +03:00
packages: read
pull-requests: write
2024-05-30 18:01:05 +03:00
steps:
2024-05-30 18:01:05 +03:00
- name: Check out repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
2024-05-30 18:01:05 +03:00
ref: ${{ github.event.pull_request.head.sha }}
2024-05-30 18:01:05 +03:00
- name: Validate Gradle wrapper
2024-07-18 19:33:15 +03:00
uses: gradle/actions/wrapper-validation@d9c87d481d55275bb5441eef3fe0e46805f9ef70 # v3.5.0
2024-02-05 21:28:09 +03:00
2024-05-30 18:01:05 +03:00
- name: Cache Gradle files
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
2024-02-05 21:28:09 +03:00
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
2024-03-15 21:37:34 +03:00
key: ${{ runner.os }}-gradle-v2-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/libs.versions.toml') }}
2024-02-05 21:28:09 +03:00
restore-keys: |
${{ runner.os }}-gradle-v2-
2024-06-01 00:42:38 +03:00
- 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
2024-07-18 19:33:15 +03:00
uses: ruby/setup-ruby@161cd54b698f1fb3ea539faab2e036d409550e3c # v1.187.0
with:
bundler-cache: true
- name: Configure JDK
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
2024-05-30 18:01:05 +03:00
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
2024-05-30 18:01:05 +03:00
- name: Build and test
run: |
bundle exec fastlane check
- name: Upload to codecov.io
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
2024-06-26 23:06:36 +03:00
file: app/build/reports/kover/reportStandardDebug.xml
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}