Persian translation by DARCKNIGHT #493
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This actions validates the gradle files and runs a build test to ensure the app is not corrupted | |
# if succeeded and the source is a pull request, builds an evaluation apk | |
name: Validate gradle build test | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
# parameters | |
env: | |
VARIANT: evaluation | |
NAME: URLCheck_evaluation.apk | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Change wrapper permissions | |
# for some reason the gradle-build-action doesn't do this automatically | |
run: chmod +x ./gradlew | |
- name: Build & test with Gradle | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: > | |
build | |
test | |
# the following steps will only run for PRs | |
- name: Generate apk | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: > | |
assemble${{ env.VARIANT }} | |
- name: Upload apk as artifact | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
path: ./app/build/outputs/apk/${{ env.VARIANT }}/app-${{ env.VARIANT }}.apk | |
name: ${{ env.NAME }} | |
retention-days: 14 | |
- name: Upload PR id as artifact | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
path: /dev/null | |
name: ${{ github.event.number }} | |
retention-days: 1 |