2024-05-30 18:01:05 +03:00
|
|
|
name: Test
|
2023-09-11 23:51:59 +03:00
|
|
|
|
|
|
|
on:
|
2024-05-30 18:01:05 +03:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- "main"
|
|
|
|
- "rc"
|
|
|
|
- "hotfix-rc"
|
|
|
|
pull_request_target:
|
|
|
|
types: [opened, synchronize]
|
2024-10-07 15:52:41 +03:00
|
|
|
merge_group:
|
|
|
|
type: [checks_requested]
|
2024-06-13 16:47:36 +03:00
|
|
|
workflow_dispatch:
|
2023-09-11 23:51:59 +03:00
|
|
|
|
|
|
|
env:
|
2024-05-30 18:48:29 +03:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2023-09-11 23:51:59 +03:00
|
|
|
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
|
|
|
|
|
2023-09-11 23:51:59 +03:00
|
|
|
test:
|
|
|
|
name: Test
|
2024-09-30 19:51:05 +03:00
|
|
|
runs-on: ubuntu-24.04
|
2024-05-30 18:01:05 +03:00
|
|
|
needs: check-run
|
|
|
|
permissions:
|
|
|
|
contents: read
|
2024-05-30 18:48:29 +03:00
|
|
|
issues: write
|
2024-05-30 18:20:07 +03:00
|
|
|
packages: read
|
2024-05-30 18:48:29 +03:00
|
|
|
pull-requests: write
|
2024-05-30 18:01:05 +03:00
|
|
|
|
2023-09-11 23:51:59 +03:00
|
|
|
steps:
|
2024-05-30 18:01:05 +03:00
|
|
|
- name: Check out repo
|
2024-10-15 18:24:00 +03:00
|
|
|
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
|
2023-09-11 23:51:59 +03:00
|
|
|
with:
|
2024-05-30 18:01:05 +03:00
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
2023-09-11 23:51:59 +03:00
|
|
|
|
2024-05-30 18:01:05 +03:00
|
|
|
- name: Validate Gradle wrapper
|
2024-09-20 21:09:13 +03:00
|
|
|
uses: gradle/actions/wrapper-validation@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
|
2024-02-05 21:28:09 +03:00
|
|
|
|
2024-05-30 18:01:05 +03:00
|
|
|
- name: Cache Gradle files
|
2024-10-15 18:24:00 +03:00
|
|
|
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
|
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
|
2024-10-15 18:24:00 +03:00
|
|
|
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
|
2024-06-01 00:42:38 +03:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{ github.workspace }}/build-cache
|
|
|
|
key: ${{ runner.os }}-build-cache-${{ github.sha }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-build-
|
|
|
|
|
2023-10-16 18:12:39 +03:00
|
|
|
- name: Configure Ruby
|
2024-10-15 18:24:00 +03:00
|
|
|
uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # v1.196.0
|
2023-10-16 18:12:39 +03:00
|
|
|
with:
|
|
|
|
bundler-cache: true
|
|
|
|
|
2023-09-11 23:51:59 +03:00
|
|
|
- name: Configure JDK
|
2024-09-30 17:52:17 +03:00
|
|
|
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 # v4.4.0
|
2023-09-11 23:51:59 +03:00
|
|
|
with:
|
2024-05-30 18:01:05 +03:00
|
|
|
distribution: "temurin"
|
2023-09-11 23:51:59 +03:00
|
|
|
java-version: ${{ env.JAVA_VERSION }}
|
|
|
|
|
2024-06-26 22:45:23 +03:00
|
|
|
- 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
|
2024-01-08 19:21:53 +03:00
|
|
|
run: |
|
2024-06-26 22:45:23 +03:00
|
|
|
bundle exec fastlane check
|
2023-10-16 18:12:39 +03:00
|
|
|
|
2024-10-23 19:53:20 +03:00
|
|
|
- name: Upload test reports on failure
|
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: test-reports
|
|
|
|
path: app/build/reports/tests/
|
|
|
|
|
2024-06-26 22:45:23 +03:00
|
|
|
- name: Upload to codecov.io
|
2024-10-15 18:24:00 +03:00
|
|
|
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
|
2024-06-26 22:45:23 +03:00
|
|
|
with:
|
2024-06-26 23:06:36 +03:00
|
|
|
file: app/build/reports/kover/reportStandardDebug.xml
|
2023-10-16 18:12:39 +03:00
|
|
|
env:
|
2024-06-26 22:45:23 +03:00
|
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|