Skip to content

Bump actions/setup-dotnet from 3 to 4 #223

Bump actions/setup-dotnet from 3 to 4

Bump actions/setup-dotnet from 3 to 4 #223

Workflow file for this run

name: App
on:
push:
paths:
- 'App/**'
- 'Service/**'
- '.github/workflows/*.yml'
branches:
- '**'
tags:
- '*.*.*'
workflow_dispatch:
env:
ARTIFACT_NAME: ServerMonitor-App
jobs:
build-test-debug:
name: Build & Test (Debug)
runs-on: ubuntu-22.04
permissions:
contents: read
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- name: Set Gradle permissions
run: chmod +x App/gradlew
- name: Build project
uses: gradle/gradle-build-action@v2
with:
arguments: assembleDebug --scan
build-root-directory: App
cache-disabled: true
- name: Run instrumented tests
uses: gradle/gradle-build-action@v2
with:
arguments: test --scan
build-root-directory: App
cache-disabled: true
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}-debug
path: App/app/build/outputs/apk/*/*
build-test-release:
name: Build & Test (Release)
runs-on: ubuntu-22.04
if: ${{ github.event_name != 'pull_request' && !startsWith( github.ref_name, 'dependabot/' ) }}
permissions:
contents: read
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- name: Set Gradle permissions
run: chmod +x App/gradlew
- name: Create key store
id: keystore
run: |
echo "${{ secrets.ANDROID_KEY_STORE }}" | base64 -d > $HOME/android-key-store.apk
echo "path=$HOME/android-key-store.apk" >> "$GITHUB_OUTPUT"
- name: Build project
env:
ANDROID_KEY_STORE_PATH: ${{ steps.keystore.outputs.path }}
ANDROID_KEY_STORE_PASSWORD: ${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
ANDROID_KEY_STORE_KEY_ALIAS: ${{ secrets.ANDROID_KEY_STORE_KEY_ALIAS }}
ANDROID_KEY_STORE_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_STORE_KEY_PASSWORD }}
uses: gradle/gradle-build-action@v2
with:
arguments: assembleRelease --scan
build-root-directory: App
cache-disabled: true
- name: Run instrumented tests
env:
ANDROID_KEY_STORE_PATH: ${{ steps.keystore.outputs.path }}
ANDROID_KEY_STORE_PASSWORD: ${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
ANDROID_KEY_STORE_KEY_ALIAS: ${{ secrets.ANDROID_KEY_STORE_KEY_ALIAS }}
ANDROID_KEY_STORE_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_STORE_KEY_PASSWORD }}
uses: gradle/gradle-build-action@v2
with:
arguments: test --scan
build-root-directory: App
cache-disabled: true
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}-release
path: App/app/build/outputs/apk/*/*