2023-09-11 23:51:59 +03:00
|
|
|
---
|
|
|
|
name: Run Check
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
env:
|
2023-09-15 00:27:34 +03:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2023-09-11 23:51:59 +03:00
|
|
|
JAVA_VERSION: 17
|
2023-10-16 18:12:39 +03:00
|
|
|
RUBY_VERSION: 3.2.2
|
2023-09-11 23:51:59 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
name: Test
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-10-23 16:30:29 +03:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-09-11 23:51:59 +03:00
|
|
|
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
|
2024-02-12 18:49:12 +03:00
|
|
|
uses: gradle/wrapper-validation-action@699bb18358f12c5b78b37bb0111d3a0e2276e0e2 # v2.1.1
|
2024-02-05 21:28:09 +03:00
|
|
|
|
|
|
|
- name: Cache Gradle Files
|
|
|
|
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
|
|
|
key: ${{ runner.os }}-gradle-v2-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-gradle-v2-
|
|
|
|
|
2023-10-16 18:12:39 +03:00
|
|
|
- name: Configure Ruby
|
2024-02-05 22:51:27 +03:00
|
|
|
uses: ruby/setup-ruby@22fdc77bf4148f810455b226c90fb81b5cbc00a7 # v1.171.0
|
2023-10-16 18:12:39 +03:00
|
|
|
with:
|
|
|
|
bundler-cache: true
|
|
|
|
ruby-version: ${{ env.RUBY_VERSION }}
|
|
|
|
|
2023-09-11 23:51:59 +03:00
|
|
|
- name: Configure JDK
|
2023-12-05 17:58:58 +03:00
|
|
|
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
|
2023-09-11 23:51:59 +03:00
|
|
|
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
|
2024-01-08 19:21:53 +03:00
|
|
|
# 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
|
2023-10-16 18:12:39 +03:00
|
|
|
|
|
|
|
- name: Danger
|
|
|
|
env:
|
|
|
|
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
run: bundle exec danger
|