mirror of
https://github.com/TrianguloY/UrlChecker.git
synced 2024-09-20 04:12:14 +02:00
f964bb7579
This reverts commit 81b5b7e1c3
.
69 lines
1.8 KiB
YAML
69 lines
1.8 KiB
YAML
# 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@v4
|
|
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@v3
|
|
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@v3
|
|
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
|