1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-11-16 14:54:57 +00:00
NewPipe/.github/workflows/ci.yml
Tobi 81d00f2e97
Run CI on PRs which target the master branch
This is a fix for the release PRs
2021-06-05 17:34:27 +02:00

104 lines
2.8 KiB
YAML

name: CI
on:
pull_request:
branches:
- dev
- master
push:
branches:
- dev
- master
jobs:
build-and-test-jvm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
- name: create and checkout branch
# push events already checked out the branch
if: github.event_name == 'pull_request'
run: git checkout -B ${{ github.head_ref }}
- name: set up JDK 8
uses: actions/setup-java@v2
with:
java-version: 8
distribution: "adopt"
- name: Cache Gradle dependencies
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build debug APK and run jvm tests
run: ./gradlew assembleDebug lintDebug testDebugUnitTest --stacktrace
- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: app
path: app/build/outputs/apk/debug/*.apk
test-android:
runs-on: macos-latest
strategy:
matrix:
api-level: [21, 29]
steps:
- uses: actions/checkout@v2
- name: set up JDK 8
uses: actions/setup-java@v2
with:
java-version: 8
distribution: "adopt"
- name: Cache Gradle dependencies
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Run android tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
script: ./gradlew connectedCheck
# sonar:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
# - name: Set up JDK 11
# uses: actions/setup-java@v2
# with:
# java-version: 11 # Sonar requires JDK 11
# distribution: "adopt"
# - name: Cache SonarCloud packages
# uses: actions/cache@v2
# with:
# path: ~/.sonar/cache
# key: ${{ runner.os }}-sonar
# restore-keys: ${{ runner.os }}-sonar
# - name: Cache Gradle packages
# uses: actions/cache@v2
# with:
# path: ~/.gradle/caches
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
# restore-keys: ${{ runner.os }}-gradle
# - name: Build and analyze
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# run: ./gradlew build sonarqube --info